ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TNO <tno...@free.fr>
Subject Re: reusing resultMaps without extending them.
Date Wed, 12 Apr 2006 15:17:58 GMT
Vote !!!
http://issues.apache.org/jira/browse/IBATIS-225

Clinton Begin a écrit :
>
> 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
> <mailto:Christopher.Mathrusse@sybase.com>* <
> Christopher.Mathrusse@sybase.com
> <mailto: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
>     <mailto:christopher.mathrusse@sybase.com>
>     Sybase, Inc
>     One Sybase Drive
>     Dublin, CA 94568
>     (925) 236-5553
>
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.3.3/296 - Release Date: 29/03/2006
>   

-- 
Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs


Mime
View raw message