ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject reusing resultMaps without extending them.
Date Mon, 27 Mar 2006 17:32:50 GMT

<br><font size=2 face="sans-serif">I can't seem to find any documentation
on this so that is why I am asking the question. I have a ResultMap and
I am try to avoid the select to load the associated object. So my SQL joins
the two tables and all works well. My problem is that I would like to use
the ResultMap already defined in another SqlMap rather than redefining
it once again. It appears that a <b><i>result</i></b> element has
the attribute
<b><i>resultMap. </i></b>I tried to configure my Sql Map as shown
but I receive an error when I attempt to do this.</font>
<br><font size=2 face="Arial">&lt;resultMap id=&quot;billToResultMap&quot;
class=&quot;BillTo&quot; &gt;</font>
<br><font size=2 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; ...</font>
<br><font size=2 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&lt;result property=&quot;paymentTerms&quot; resultMap=&quot;PaymentTerms.PaymentTermsResult&quot;
<br><font size=2 face="Arial">&lt;/resultMap&gt;</font>
<br><font size=2 face="sans-serif">Produces the following exception:</font>
<br><font size=2 color=#000080 face="Courier New"><u>com.ibatis.sqlmap.client.SqlMapException</u></font><font
size=2 face="Courier New">:
Error instantiating collection property for mapping 'paymentTerms'. &nbsp;Cause:
</font><font size=2 color=#000080 face="Courier New"><u>java.lang.ClassCastException</u></font>
<br><font size=2 face="sans-serif">Is there a way to reuse result maps
without extending them?</font>
<br><font size=2 face="sans-serif">Thanks...</font>
<br><font size=2 face="sans-serif"><br>
Chris Mathrusse<br>
Sybase, Inc<br>
One Sybase Drive<br>
Dublin, CA 94568<br>
(925) 236-5553</font>

View raw message