ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DavidZaz <dzaze...@cait.org>
Subject Re: Nested POJO and resultMap tag
Date Wed, 09 Dec 2009 21:42:16 GMT

Sorry to bother everyone, but I figured it out.

There is nothing wrong with my ibatis resultMap. My issue was caused by a
problem with the join in my SQL statement (which I used to load the
properties belonging to the sub-class - in this example it was the tire
class).


DavidZaz wrote:
> 
> I have a POJO where one of its properties refers to a nested object. For
> example,
> 
> class car {
> 
> Tire wheels;
> 
> }
> 
> class Tire {
> 
> int size;
> String brandName;
> 
> }
> 
> How can I make a resultMap in my ibatis sql file to populate both the car
> and the wheels at the same time?
> 
> I already tried the following (but the wheel object was not populated):
> 
> <resultMap id="myResult" class="car">
>       <result property="wheels.size" column="WHEEL_SIZE" />
>       <result property="wheels.brandName" column="BRAND_NAME" />
> </resultMap>
> 

-- 
View this message in context: http://old.nabble.com/Nested-POJO-and-resultMap-tag-tp26717930p26717984.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message