I have one java class which resembles to
class A {
String a;
B bclass;
}
class B {
String b;
String c;
}
my ibatis query is : Select a,b,c from A_TABLE
and resultmap I want is something like this where I can fill properties of class B (B.b,B.c) as well.
<resultMap class="A" id="resmap">
<result property="a" column="A" jdbcType="VARCHAR"/>
<result property="bclass.b" column="B" jdbcType="VARCHAR"/>
<result property="bclass.c" column="C" jdbcType="VARCHAR"/>
</resultmap>
any idea how I can fill this object A from ibatis query so I have all 3 a,b,c properties filled?
The mapping of inner objects is made with
associationtag. You need something like this:Check documentation as well, it's explained in details.