Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 44652 invoked from network); 14 Aug 2007 06:55:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Aug 2007 06:55:00 -0000 Received: (qmail 93262 invoked by uid 500); 14 Aug 2007 06:54:58 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 92640 invoked by uid 500); 14 Aug 2007 06:54:57 -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 92629 invoked by uid 99); 14 Aug 2007 06:54:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Aug 2007 23:54:57 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,MISSING_MID,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of normad2@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 14 Aug 2007 06:55:03 +0000 Received: (qmail invoked by alias); 14 Aug 2007 06:54:28 -0000 Received: from p578b38bf.dip0.t-ipconnect.de (EHLO hw040410) [87.139.56.191] by mail.gmx.net (mp022) with SMTP; 14 Aug 2007 08:54:28 +0200 X-Authenticated: #37214314 X-Provags-ID: V01U2FsdGVkX1+7LngA01C7gtofBfI23evPgojw5xZ9rqYSz9gHWa 4fPSx7VG1U2KJN From: "Normad2" To: Subject: AW: Map of Lists Date: Tue, 14 Aug 2007 08:54:28 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0006_01C7DE50.B96B37B0" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: Thread-Index: AcfeEocOsGJO8vPHRR63lMGYIK1GyQAK1PQg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org Message-Id: <20070814065509.C266B4DA31F@nike.apache.org> This is a multi-part message in MIME format. ------=_NextPart_000_0006_01C7DE50.B96B37B0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi George, have you allready tried to implement a RowHandler? public class TestRowHandler implements RowHandler { private Map map = new HashMap(); public void handleRow(Object valueObject) { Entity row = (Entity)valueObject; map.put(row.class, row); } public Map getMap(){ return this.map; } } Then you can use it like this: TestRowHandler rh = new TestRowHandler(); sqlMapClient().queryWithRowHandler("your.statementid", rh); rh.getMap(); Best regards, Tilo _____ Von: George Dawoud [mailto:gdawoud@real.com] Gesendet: Dienstag, 14. August 2007 03:29 An: user-java@ibatis.apache.org Betreff: Map of Lists Hi All, can someone tell me if this can be done... QRY Select type, name from table order by type, name where the result will be TYPE NAME type1 aaa type1 bbb type2 ccc type3 axzd I want a map with 3 Keys (type1, type2, and type3) and the value of each Key is the list or Names? can this be done... i tried this and no luck Thanks George ------=_NextPart_000_0006_01C7DE50.B96B37B0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hi George,
 
have you allready tried to implement a=20 RowHandler?
public class = TestRowHandler=20 implements RowHandler {
    private Map<Type,=20 Value> map =3D new HashMap<Type, = Value>();
 
    public void = handleRow(Object=20 valueObject) {
        = Entity row=20 =3D (Entity)valueObject;
       =20 map.put(row.class, row);
    }
 
    public Map<Type, = Value>=20 getMap(){
        = return=20 this.map;
    }
}
 
Then=20 you can use it like this:
TestRowHandler rh =3D new = TestRowHandler();
sqlMapClient().queryWithRowHandler("your.statementid",=20 rh);
rh.getMap();
 
Best=20 regards, Tilo


Von: George Dawoud = [mailto:gdawoud@real.com]=20
Gesendet: Dienstag, 14. August 2007 03:29
An:=20 user-java@ibatis.apache.org
Betreff: Map of = Lists

Hi All,

can someone tell me if this can be done...

QRY

Select type, name
from table
order by type, name

where the result will be

TYPE = NAME
type1 = aaa
type1 = bbb
type2 = ccc
type3 = axzd


I want a map with 3 Keys (type1, type2, and type3) and the value of = each=20 Key is the list or Names?

can this be done... i tried this and no luck

<resultMap id=3D"get-types" class=3D"java.util.HashMap" groupBy=3D"key">
<result property=3D"key" column=3D"name" />
<result property=3D"val" resultMap=3D"get-names"/>
</resultMap>



<resultMap id=3D"get-names" class=3D"java.util.ArrayList">
<result property=3D"name" resultMap=3D"name" />
</resultMap>


<select id=3D"retrieveRelatedTo" resultMap=3D"get-cnt-cnt-connections">
Select type,=20 name
from = table
order by type,=20 name
</select>

Thanks
George =

------=_NextPart_000_0006_01C7DE50.B96B37B0--