You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by TNO <tn...@free.fr> on 2006/04/12 17:17:58 UTC
Re: reusing resultMaps without extending them.
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
> <ma...@sybase.com>* <
> Christopher.Mathrusse@sybase.com
> <ma...@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
> <ma...@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
Re: reusing resultMaps without extending them.
Posted by Clinton Begin <cl...@gmail.com>.
Contribute !!!
http://issues.apache.org/jira/browse/IBATIS-225
On 4/12/06, TNO <tn...@free.fr> wrote:
>
> 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 <Ch...@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
> >
>
> ------------------------------
>
> 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
>
>