ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin" <clinton.be...@gmail.com>
Subject Re: reusing resultMaps without extending them.
Date Thu, 30 Mar 2006 03:50:48 GMT
Hmm...unfortunately at this time your two choices are to extend it or
duplicate it.

As you've discovered, the resultMap attribute of the result element is
strictly for collections only.

Cheers,
Clinton

On 3/27/06, Christopher.Mathrusse@sybase.com <
Christopher.Mathrusse@sybase.com> wrote:
>
>
> 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 *result*element has the
attribute
> *resultMap. *I tried to configure my Sql Map as shown below, but I receive
> an error when I attempt to do this.
>
> <resultMap id="billToResultMap" class="BillTo" >
>         ...
>             <result property="paymentTerms" resultMap="
> PaymentTerms.PaymentTermsResult" "/>
> </resultMap>
>
>
> Produces the following exception:
> *com.ibatis.sqlmap.client.SqlMapException*: Error instantiating collection
> property for mapping 'paymentTerms'.  Cause: *java.lang.ClassCastException
> *
>
>
>
> Is there a way to reuse result maps without extending them?
>
> Thanks...
>
> Chris Mathrusse
> christopher.mathrusse@sybase.com
> Sybase, Inc
> One Sybase Drive
> Dublin, CA 94568
> (925) 236-5553
>

Mime
View raw message