Nested object mapping

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Nested object mapping

Максим Касьянов
Hi,

I have annotation base myBatis configuration.
How i can map nested object with annotaion?
Thank you in advance.

For instance:

class Example{


 
public String field1;
 
public NestedObject nestedObect;
 
}


class NestedObject{


 
public String field2;
 
}


class ExampleMapper{


 
@Select("select 'field1' as field1, 'field2' as nestedObjectField")
 
Example map();


}

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Nested object mapping

Guy Rouillier-2
Try nestedObject.field2.

--
Guy Rouillier

------ Original Message ------
From: "Максим Касьянов" <[hidden email]>
To: "mybatis-user" <[hidden email]>
Sent: 1/18/2019 12:40:40 PM
Subject: Nested object mapping

Hi,

I have annotation base myBatis configuration.
How i can map nested object with annotaion?
Thank you in advance.

For instance:

class Example{


 
public String field1;
 
public NestedObject nestedObect;
 
}


class NestedObject{


 
public String field2;
 
}


class ExampleMapper{


 
@Select("select 'field1' as field1, 'field2' as nestedObjectField")
 
Example map();


}

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.