ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Viv Kapadekar <vi...@peoplepowerco.com>
Subject [IBatis3-beta10] nested results for collection
Date Wed, 07 Apr 2010 01:52:33 GMT
Hi
I have a Class X containing a List of Class Y

Class X {
String a
List<Y> b
}

Class Y {
String index
String desc
}

The resultMap I have is

<resultMap id="someID" type="X">
		<id property="a" column="id"/>
			<collection property="b" ofType="Y">
                                       <id property="index"  
column="index" />
					<result property="desc" column="desc"/>  -->
			</collection>
</resultMap>

This is fine, but I don't want the resulting X to have the collection  
b set, if the "index" value is null. If index is null, even the value  
of b in X should be null.  I tried using <discriminator> and also  
tried creating a separate sql, but no luck. Any ideas?

-V



---------------------------------------------------------------------
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