Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 81453 invoked from network); 5 Nov 2009 14:57:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Nov 2009 14:57:06 -0000 Received: (qmail 11315 invoked by uid 500); 5 Nov 2009 14:57:05 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 11293 invoked by uid 500); 5 Nov 2009 14:57:05 -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 11285 invoked by uid 99); 5 Nov 2009 14:57:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Nov 2009 14:57:05 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Nov 2009 14:57:02 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1N63lR-0005zU-Th for user-java@ibatis.apache.org; Thu, 05 Nov 2009 06:56:41 -0800 Message-ID: <26215734.post@talk.nabble.com> Date: Thu, 5 Nov 2009 06:56:41 -0800 (PST) From: btymvios To: user-java@ibatis.apache.org Subject: Re: Collection with composite key in XML mapping In-Reply-To: <26208650.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: byron@scube.co.za References: <26208650.post@talk.nabble.com> Apologies, there is a typo in my last post the "select" should have read: btymvios wrote: >=20 > Hi All, >=20 > Please could someone assist, I know this might be a silly question with a > simple answer but I have tried all examples I have found, I have read the > documentation and I have searched the forums and the internet but to no > avail. >=20 > I am using the latest beta version of iBatis 3 (beta 5) but had the same > problem with beta 4. In iBatis v2x these complex key mappings worked fine= . >=20 > The documentation states: >=20 > "Note: To deal with composite keys, you can specify multiple column names > to pass to the nested select statement by using the syntax > column=3D=E2=80=9D{prop1=3Dcol1,prop2=3Dcol2}=E2=80=9D. This > will cause prop1 and prop2 to be set against the parameter object for the > target nested select statement." >=20 > However when I specify this with multiple columns for a collection the > nested select is never run and no error is reported. In the referenced > "select" I am accessing the parameters by #{param1Name} and #{param2Name} > (where param1Name is the name of the first param etc..). >=20 > If I remove this and only specify one parameter like column=3D"col_1" the= n > the referenced "select" is executed and the same param is used for both > parameter mapping in the select. So the collection mapping can access the > nested select and return a list of the correct type (albeit with a lot of > incorrect rows due to not matching on the full complex key) but not when = I > have complex keys specified. >=20 > What is the correct notation for using multiple columns for complex keys > from a "collection" mapping. There are no examples in the documentation > other than the excerpt above. I have also not found any workable examples > on the internet. >=20 > I have found references on the internet to accesing params with @{param} > instead of #{param} which I have also tried with no luck. I have also > tried specifying paramaterType=3D"map" on the nested select with no resul= ts. >=20 > ResultMap (XML file 1): > > > > > javaType=3D"ArrayList" ofType=3D"MyType" > select=3D"other.xml.namespace.MyTypeNS.nestedSelect" /> > >=20 > Select (XML file 2): > > > > > > >=20 > Thanks for your time. > Byron >=20 --=20 View this message in context: http://old.nabble.com/Collection-with-composi= te-key-in-XML-mapping-tp26208650p26215734.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org For additional commands, e-mail: user-java-help@ibatis.apache.org