ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CuriousMind <yogeshcjad...@hotmail.com>
Subject Nested result maps
Date Tue, 04 Aug 2009 04:57:37 GMT

Hi,

I am having strange problem with resultmap. Consider following scenario
<resultMap id="map1" class="com.mycode.ClassOne">
<result property="prop1" column="dbcol1"/>
<result property="prop2" column="dbcol2"/>
</resultMap>

<resultMap id="map2" class="com.mycode.ClassTwo">
<result property="propForMap" resultMap="map1"/>
</resultMap>

<resultMap id="map3" class="com.mycode.ClassThree">
<result property="someProperty" column="dbcol3"/>
<result property="moreProperty" column="dbcol4"/>
<result property="additionalProp" resultMap="map2"/>
</resultMap>

The last resultMap is mapped with output map of cursor returned by
procedure.
After calling ibatis api to execute procedure, I found that properties for
map3 (someProperty, moreProperty) is initialised but additionalProp is
unitialised. I have checked that all the properties are mapped properly.
To add to surprise, if I change definition of map2 to following it works.
<resultMap id="map2" class="com.mycode.ClassTwo">
<result property="useLessProperty" column="someColumn"/>
<result property="propForMap" resultMap="map1"/>
</resultMap>

If I add one more result tag to map2 it works fine, I couldnt understand why
iBatis is not able to resolve map2 when it has only one nested map.
-- 
View this message in context: http://www.nabble.com/Nested-result-maps-tp24802326p24802326.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