ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ole Trenner <ole.tren...@gmx.de>
Subject Re: appending to collection properties
Date Wed, 22 Aug 2007 15:04:16 GMT
Clinton Begin wrote:
> The other way to do this is to use a discriminator result map.  All of the
> objects implement ILabelled, so that can be the returned type from the
> resultmap.  You can then either UNION or JOIN somehow all 3 SQL statements
> into a single call (also better for performance usually...not always).  
> 
[..]
> 
> <resultMap id="ILabelledResults" class="ILabelled">
>   <!-- ...common fields go here ... -->
>   <discriminator column="type" javaType="int">
>     <subMap value="Company" resultMap="CompanyResult"/>
>     <subMap value="Event" resultMap="EventResult"/>    
>     <subMap value="Article" resultMap="ArticleResult"/>  
>   </discriminator>
> </resultMap>

That sounds perfect! I'm definitely going to give it a try.
Thanks.

Cheers -
Ole.


Mime
View raw message