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.

Reply via email to