Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 90173 invoked from network); 10 May 2006 06:44:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 May 2006 06:44:59 -0000 Received: (qmail 8394 invoked by uid 500); 10 May 2006 06:44:57 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 8374 invoked by uid 500); 10 May 2006 06:44:56 -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 8363 invoked by uid 99); 10 May 2006 06:44:56 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 May 2006 23:44:56 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.247.21.91] (HELO wis.nl) (83.247.21.91) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 May 2006 23:44:55 -0700 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C673FD.2E96B86C" X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Subject: RE: queryForMap returning zero results Date: Wed, 10 May 2006 08:44:26 +0200 Message-ID: <50CA25BD6EEA954FA592C097399942E30E463FFB@CM1.wis.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: queryForMap returning zero results Thread-Index: AcZz79IZLphK1+1lR+6UTgUoV6WFPgABYVOAAAHsEiA= From: "Niels Beekman" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------_=_NextPart_001_01C673FD.2E96B86C Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Are the productcategory id's unique? queryForMap() will use that as a key, so if all id's are the same, map.size() will be 1. =20 ________________________________ From: Firas A. [mailto:ofbiz@idigna.com]=20 Sent: woensdag 10 mei 2006 8:25 To: user-java@ibatis.apache.org Subject: RE: queryForMap returning zero results =20 Thanks Niels for your answer. =20 I'm affraid I haven't been completely correct in my description of the issue. Sorry about that. queryForMap does actually return 1 (one) value, the last row in the resultset. About accessor methods: I do have getProductCategoryId() and setProductCategoryId(String productCategoryId) in ProductCategory class. =20 But why queryForMap returns only the last row from the resultset? =20 Thanks again! =20 =20 =20 =20 =09 ________________________________ From: Niels Beekman [mailto:n.beekman@wis.nl]=20 Sent: den 9 maj 2006 20:28 To: user-java@ibatis.apache.org Subject: RE: queryForMap returning zero results That's very strange, since queryForMap() uses queryForList() internally. Is there a proper getter in class 'com.mycompany.ecommerce.ProductCategory' for the 'productCategoryId' property? =20 Niels =20 =09 ________________________________ From: Firas A. [mailto:ofbiz@idigna.com]=20 Sent: dinsdag 9 mei 2006 20:05 To: user-java@ibatis.apache.org Subject: queryForMap returning zero results =20 Hello everybody! =09 I'm getting zero results when using queryForMap. Whith queryForList I get the correct results. =09 ----- SQLMap ----- =09 =09 ----- Java ----- public Map listAvailableCategories() throws SQLException { Map prodCatRel =3D sqlMapClient.queryForMap("listAvailableCategories", null, "productCategoryId"); return prodCatRel; } =09 In the logging output I can clearly see that there are several rows in the resultset, but prodCatRel.size()=3D=3D0.=20 =20 Anybody have an idea?=20 =20 Thanks for your time!=20 =20 =20 ------_=_NextPart_001_01C673FD.2E96B86C Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Are the productcategory id’s = unique? queryForMap() will use that as a key, so if all id’s are the same, = map.size() will be 1.

 


From: Firas = A. [mailto:ofbiz@idigna.com]
Sent: woensdag 10 mei = 2006 8:25
To: user-java@ibatis.apache.org
Subject: RE: queryForMap = returning zero results

 

Thanks Niels for your = answer.

 

I'm affraid I haven't been completely correct in my description of the issue. Sorry about that. queryForMap does actually = return 1 (one) value, the last row in the resultset. About accessor methods: = I do have getProductCategoryId()=   and setProductCategoryId(S= tring productCategoryId) in ProductCategory = class.

 

But why queryForMap returns only the last row = from the resultset?

 

Thanks again!

 

</Firas>

 

 


From: Niels Beekman [mailto:n.beekman@wis.nl] =
Sent: den 9 maj 2006 = 20:28
To: user-java@ibatis.apache.org
Subject: RE: queryForMap = returning zero results

That’s very strange, since queryForMap() uses queryForList() internally. Is there a proper getter = in class ‘com.mycompany.ecommerce.ProductCategory’ for the ‘productCategoryId’ property?

 

Niels

 


From: Firas = A. [mailto:ofbiz@idigna.com]
Sent: dinsdag 9 mei 2006 = 20:05
To: user-java@ibatis.apache.org
Subject: queryForMap = returning zero results

 

Hello everybody!

I'm getting zero results when using queryForMap. Whith queryForList I = get the correct results.

----- = SQLMap -----
<resultMap id=3D"listOfCategories" class=3D"com.mycompany.ecommerce.ProductCategory">
        <result column=3D"product_category_id" = property=3D"productCategoryId" jdbcType=3D"VARCHAR" />
        <result column=3D"parent_category_id" = property=3D"parentCategoryId" jdbcType=3D"VARCHAR" />
        <result column=3D"category_name" property=3D"categoryName" jdbcType=3D"VARCHAR" />
</resultMap>


<select id=3D"listAvailableCategories" resultMap=3D"listOfCategories">
        SELECT
            &= nbsp; product_category_id,
            &= nbsp; parent_category_id,
            &= nbsp; category_name
        FROM  = product_category
</select>


----- = Java -----

public Map listAvailableCategories() throws SQLException {
        Map prodCatRel =3D = sqlMapClient.queryForMap("listAvailableCategories", null, "productCategoryId");
        return prodCatRel;
}


In the logging output I can clearly see that there are several rows in = the resultset, but = prodCatRel.size()=3D=3D0. 

 

Anybody have an = idea? 

 

Thanks for your = time! 

 

</Firas>

------_=_NextPart_001_01C673FD.2E96B86C--