ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Medium <contactm...@gmail.com>
Subject Reusing resultmap for nested object
Date Wed, 16 Nov 2005 05:08:10 GMT
Hi,

Is there a way to reuse a resultmap for a nested object ?

I know how to map it as specified by the docs but its getting a bit 
unwieldly with all the repetition.

Docs:
<resultMap>
<result property=”id” column=”PRD_ID”/>
<result property=”description” column=”PRD_DESCRIPTION”/>
<result property=”category.id” column=”CAT_ID” />
<result property=”category.description” column=”CAT_DESCRIPTION” />
</resultMap>

Goal:
<resultMap id="product">
<result property=”id” column=”PRD_ID”/>
<result property=”description” column=”PRD_DESCRIPTION”/>
<result property="category" resultMap="category">
</resultMap>

<resultMap id="category">
<result property=”id” column=”CAT_ID”/>
<result property=”description” column=”CAT_DESCRIPTION”/>
</resultMap>

Any help would be greatly appreciated. A simple yah or nah would do fine 
as well.

Thanks

Huy


Mime
View raw message