ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sanders <tendan...@gmail.com>
Subject Stored Procedure Call Returns Empty List But Does Create Beans
Date Wed, 11 Apr 2007 20:13:06 GMT

[Hate to post again so quickly, I used to think I knew what I was doing in
this space but it seems not.... hopefully someone can help me here and then
I promise to go away.]

I have a stored procedure that is just a wrapper around a "SELECT *" and I
have straight JDBC code that uses it and works. So I'm trying to move to
Spring/iBATIS - my code to execute the query runs but the returned List
object is empty. If I log each constructor call and setter call I get the
appropriate output - the beans are being created, and with the right values,
but somehow aren't being returned in the List. Is this a common beginners

Not sure how much of the code is valuable but here is some...

public List<BanPolicy>fetchBanPolicies()
   return getSqlMapClientTemplate().queryForList("fetch-ban-policies"); //
returns empty list

the mapping file...

  <resultMap class="BanPolicy" id="fetch-ban-policies-map">
       <result property="banPolicyID" columnIndex="1" javaType="int" />
       <result property="applicationID" columnIndex="2" javaType="int" />
       <result property="minBanCount" columnIndex="3" javaType="int" />
       <result property="maxBanCount" columnIndex="4" javaType="int" />
       <result property="accountBanDays" columnIndex="5" javaType="float" />
       <result property="dnasBanDays" columnIndex="6" javaType="float" />
       <result property="banReasonId" columnIndex="7" javaType="int" />

   <parameterMap id="fetch-ban-policies-rs" class="map">
       <parameter property="o" javaType="java.sql.ResultSet"
jdbcType="ORACLECURSOR" mode="OUT" resultMap="fetch-ban-policies-map" />

   <procedure id="fetch-ban-policies" parameterMap="fetch-ban-policies-rs">
      { call .getBanPolicies(?) }

and the spring deftn.....

   <bean id="banPolicyDAO"
        <property name="sqlMapClient" ref="sqlMapClient"/>

I'm going to do a hard coded SQL version just to get something working


View this message in context: http://www.nabble.com/Stored-Procedure-Call-Returns-Empty-List-But-Does-Create-Beans-tf3561741.html#a9947480
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

View raw message