ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rutherford, Matthew [CIB-IT]" <matthew.rutherf...@citigroup.com>
Subject RE: Ibatis not returning any results
Date Fri, 03 Nov 2006 11:21:48 GMT
Apologies, in the select tag, it should read id="getLatestItemByFii"

-----Original Message-----
From: Rutherford, Matthew [CIB-IT] 
Sent: 03 November 2006 11:15
To: user-java@ibatis.apache.org
Subject: Ibatis not returning any results

Hi I am using Ibatis SQL Maps 2.1.7

Currently I have the following query in my SqlMapItemDao:

getSqlMapClientTemplate().queryForList("getLatestItemByFii", item);

The sql map looks like:

<resultMap id="result" class="Item">
  	<result property="Id" column="id" columnIndex="1"/>
  	<result property="currencyCode" column="currency_code" columnIndex="2"/>
  	<result property="fii" column="fii" columnIndex="3"/>
  	<result property="positionAsAt" column="position_as_at" columnIndex="4"/>  	
	<result property="pos" column="pos" columnIndex="5"/>

<select id="getLatestPositionByFii" resultMap="result">
    SELECT id,currency_code,fii, to_char(max(position_as_at)), pos
    FROM item
    WHERE fii = #fii# and pos != 0
    GROUP BY id,currency_code,fii,pos

with sql debugging turned on, there is no error msg returned.

If I try the same query in my sql client app I get 1 row of data back.  But the queryForList()
returns nothing to me, and I logged the item object's variables to make sure it was the same
parameter.  It is.  Why is the List not being populated with the same data?

Thanks for any insight,

View raw message