ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy Rouillier <guyr-...@burntmail.com>
Subject Re: performance issue for id as association
Date Sun, 21 Feb 2010 00:03:30 GMT
On 2/20/2010 3:21 PM, Jakub Vondrak wrote:
> Hello,
> I'm new to iBatis 3 so maybe I'm overooking something obvious, but I'm
> having problem while trying to map id object as association.
> Here is my result map
>     <resultMap id="billResultMap" type="Bill">
>        <id column="bill_id" property="id" />
>        <collection property="billItems" ofType="BillItem">
>            <result column="bi_sku" property="customId" />
>            <result column="bi_name" property="name" />
>            ...
>           <association property="id" javaType="BillItemId">
>              <id column="bill_id" property="idBill"/>
>              <id column="bill_id" property="itemOrder" />
>           </association>
>        </collection>
>     </resultMap>
> Problem is that class BillItem has another class BillItemId which acts
> as ID, but I'm not able to express this fact in result map.
> This is probably the reason why I'm having performance problems
> (java.lang.OutOfMemoryError: Java heap space).

That's not a performance problem, that's an out-of-memory problem.  You 
probably have a circular reference.  Take a look in the User Guide PDF 
in the section titled Advanced Result Mapping.  It has an example using 
an association.  An association is a 1-to-1 mapping.  Your example above 
doesn't identify a column on which to establish the association.  It 
also lists two <id> entries, both for the same source column.  That 
can't be right.

Guy Rouillier

To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org

View raw message