As far as I know you can not do this the way you would think.

I am sure it could be done with two result maps, one for each arm.

Second part is that you will not be able to use .* notation.  You will have to alias the column.

On Fri, May 9, 2008 at 7:29 AM, steve mcdowell <> wrote:

I have, for example, two tables PERSON, ARM.  Lets say that, amongst other
things, PERSON has two columns LEFT_ID and RIGHT_ID, which are references
into the primary key for the ARM table.

My best (wrong) guess is to write something like this:

class Person {
 Arm left;
 Arm right;

<resultMap id="person" class="Person">
 <result property="left"     resultMap="Stuff.arm"/>
 <result property="right"    resultMap="Stuff.arm"/>

<resultMap id="arm" class="Arm">

<select id="get" resultMap="person">
   p.*, left.*, right.*

This doesn't seem to work, probably because I am not specifying that the
properties should use the respective SQL alias.  It seems that both arms are
ending up as right arms, or whichever is retrieved last in the SQL.

Unfortunately, I can see no way of solving this in the documentation.  Am I
missing something / taking the wrong approach?
View this message in context:
Sent from the iBATIS - User - Java mailing list archive at