Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 49160 invoked from network); 30 Mar 2006 03:51:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Mar 2006 03:51:12 -0000 Received: (qmail 31373 invoked by uid 500); 30 Mar 2006 03:51:10 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 31358 invoked by uid 500); 30 Mar 2006 03:51:10 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 31345 invoked by uid 99); 30 Mar 2006 03:51:10 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Mar 2006 19:51:10 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of clinton.begin@gmail.com designates 64.233.166.182 as permitted sender) Received: from [64.233.166.182] (HELO pproxy.gmail.com) (64.233.166.182) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Mar 2006 19:51:09 -0800 Received: by pproxy.gmail.com with SMTP id i49so380734pye for ; Wed, 29 Mar 2006 19:50:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=QnNCjITg4SB+HiOO/JINzkHrp4FHLpzymzIsjpf/IVCOAClXkfM34l2p5mha4JpSeoVe9ouxxBR2KvHmhvXuk1axxbDifZNxEukzCC/l9dJdX/Wd8R9lnlqCd4DyRv3HhqThxroGFTnkStuxS6qXyTNPAungK4pdE4VN9VnqenA= Received: by 10.65.234.20 with SMTP id l20mr471609qbr; Wed, 29 Mar 2006 19:50:48 -0800 (PST) Received: by 10.65.163.6 with HTTP; Wed, 29 Mar 2006 19:50:48 -0800 (PST) Message-ID: <16178eb10603291950t110b8oa1a865f8ef2fdf80@mail.gmail.com> Date: Wed, 29 Mar 2006 20:50:48 -0700 From: "Clinton Begin" To: user-java@ibatis.apache.org Subject: Re: reusing resultMaps without extending them. In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11915_19319335.1143690648653" References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_11915_19319335.1143690648653 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 anot= her > SqlMap rather than redefining it once again. It appears that a *result*el= ement has the attribute > *resultMap. *I tried to configure my Sql Map as shown below, but I receiv= e > an error when I attempt to do this. > > > ... > PaymentTerms.PaymentTermsResult" "/> > > > > Produces the following exception: > *com.ibatis.sqlmap.client.SqlMapException*: Error instantiating collectio= n > property for mapping 'paymentTerms'. Cause: *java.lang.ClassCastExceptio= n > * > > > > 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 > ------=_Part_11915_19319335.1143690648653 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hmm...unfortunately at this time your two choices are to extend it or d= uplicate it. 

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

Cheers,=
Clinton

On 3/27/06, Christopher.Mat= hrusse@sybase.com < Christopher.Mathrusse@sybase.com> wrote:

I can't seem to find any documenta= tion 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 attri= bute resultMap. I tried to configure my Sql Map as shown below, but I receive an error when I attempt to do this.

<resultMap id=3D"billToResultMa= p" class=3D"BillTo" >
        ...
          &nbs= p; <result property=3D"paymentTerms" resultMap=3D"PaymentTer= ms.PaymentTermsResult" "/>
</resultMap>


Produces the following exception:<= /font>
com.ibatis.s= qlmap.client.SqlMapException: Error instantiating collection property for mapping 'paymentTerms'.  C= ause: java.lang= .ClassCastException



Is there a way to reuse result map= s without extending them?

Thanks...

Chris Mathrusse
christopher.mathrusse@s= ybase.com
Sybase, Inc
One Sybase Drive
Dublin, CA 94568
(925) 236-5553

------=_Part_11915_19319335.1143690648653--