Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 48387 invoked from network); 3 Mar 2006 16:22:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Mar 2006 16:22:08 -0000 Received: (qmail 8281 invoked by uid 500); 3 Mar 2006 16:22:53 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 7964 invoked by uid 500); 3 Mar 2006 16:22:51 -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 7951 invoked by uid 99); 3 Mar 2006 16:22:50 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Mar 2006 08:22:50 -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 graj27@gmail.com designates 64.233.162.194 as permitted sender) Received: from [64.233.162.194] (HELO zproxy.gmail.com) (64.233.162.194) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Mar 2006 08:22:50 -0800 Received: by zproxy.gmail.com with SMTP id i1so736390nzh for ; Fri, 03 Mar 2006 08:22:29 -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=TFcfc+IP7+OWpBtCedacfA/OvoI3TQWsRxZpe4YkfA3y4/Ijw7aBqKt3Wxr8QRAeXCFZRB4NEuqh9m4YxT+uYqtJdETinj7bnxla4c8kZzWnT/7bBfROF0uwrvlpCSud0Y48FG81xL11JwTIRw12D3c2NMuMNRf9D14qUE/gO+M= Received: by 10.35.111.7 with SMTP id o7mr1157850pym; Fri, 03 Mar 2006 08:22:28 -0800 (PST) Received: by 10.35.125.19 with HTTP; Fri, 3 Mar 2006 08:22:28 -0800 (PST) Message-ID: <53bb0e4a0603030822r18fae455k5a06803d2a219b35@mail.gmail.com> Date: Fri, 3 Mar 2006 11:22:28 -0500 From: "Rajanikanth Gaddam" To: user-java@ibatis.apache.org Subject: Re: implementing HashMap of HashMaps in resultMap... In-Reply-To: <53bb0e4a0603030810h16044adat9f75f6190adb4d13@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4624_16749793.1141402948362" References: <53bb0e4a0603030810h16044adat9f75f6190adb4d13@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_4624_16749793.1141402948362 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline How do I implement map of maps using Ibatis? I have included the sql config file. > > I am expecting a following result: > HashMap --> key --> manager > value --> java.util.Map --> key --> > orderId > value > --> List of beans of type test.Trade > > I appreciate all the help. > > > > > > > > > > java.util.ArrayList"/> > > > > > > > > > /> > /> > > > > > > Thanks and Regards > Raj > ------=_Part_4624_16749793.1141402948362 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
How do I implement=20 map of maps using Ibatis? I have included the sql config=20 file.
= I am expecting a following=20 result:
HashMap -->   = =20 key   --> manager
     &n= bsp;            = ;     value --> java.util.Map=20 -->    key     -->  &nbs= p;  orderId
     &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;       =20 value    -->    List of beans of type= test.Trade 
 
I appreciate all the=20 help.
 
<sqlMap namespace=3D"report&qu= ot;>
 <resultMap=20 id=3D"getDataMap" class=3D"test.ResultHolder" groupBy= =3D"manager">
  <result=20 property=3D"manager" column=3D"mgr" />
 &nbs= p;<result property=3D"orderIdMap"=20 resultMap=3D"orderIdMap" />
 </resultMap>
=
 
 <resultMap id=3D"orderId= Map"=20 class=3D"java.util.HashMap" groupBy=3D"orderId">
=   <result=20 property=3D"orderId" column=3D"order_id" />
 = ; <result property=3D"beanList"=20 resultMap=3D"beanList"=20 javaType=3D"java.util.ArrayList"/>
 </resultMap>=
 
 <resultMap id=3D"beanLis= t"=20 class=3D"test.Trade">
  <result property=3D&qu= ot;txnId" column=3D"txn_id"=20 />
  <result property=3D"tradeDisplayType" col= umn=3D"trd_display_id"=20 />
  <result property=3D"tradeType" column=3D&= quot;trd_type"=20 />
  <result property=3D"numberOfShares" colum= n=3D"shr_face"=20 javaType=3D"double" />
  <result property=3D&q= uot;sharePrice" column=3D"u_price"=20 javaType=3D"double" />
  <result property=3D&q= uot;tradeDate" column=3D"txn_date"=20 javaType=3D"java.util.Date" />
  <result prope= rty=3D"settleDate"=20 column=3D"set_date" javaType=3D"java.util.Date"=20 />
 </resultMap>
 
 <select id=3D"getData&qu= ot;=20 resultMap=3D"getDataMap">
 select=20
  mgr,
  order_id,
  oms_order_id ,=
  gloss_txn_id=20 ,
  trd_display_id,
  trd_type,
  sh= r_face,
  u_price,
  txn_date
  &nbs= p; =20 from
  Tab_A
 </select>
</sqlMap>
 
Thanks and=20 Regards
Raj

------=_Part_4624_16749793.1141402948362--