Thanks again for the replies - I have a working method - yea! In the end it
seemed to take a little bit of everyone's suggestions for it to work. This
is what I ended up with - my DAO method:
public List<BanPolicy> fetchBanPolicies()
{
Map map = new HashMap();
getSqlMapClientTemplate().queryForList("fetch-ban-policies",
map);
return (List<BanPolicy>)map.get("banPolicies");
}
and my SQLMap:
<parameterMap id="fetch-ban-policies-rs" class="map">
<parameter property="banPolicies" javaType="java.sql.ResultSet"
jdbcType="ORACLECURSOR" mode="OUT" resultMap="fetch-ban-policies-map"/>
</parameterMap>
<procedure id="fetch-ban-policies" parameterMap="fetch-ban-policies-rs"
>
{ call getBanPolicies(?) }
</procedure>
and I get a perfect List of BanPolicy objects. If I leave out the javaType
attribute then the banPolicies object in the Map turns out to be an
OracleResultSet rather than a List.
Your help much appreciated, feels like everything should be real
straightforward from here.
Jeff Butler-2 wrote:
>
> The list is not returned from the queryForList method because the
> resultSet
> is an output parameter - not a resultSet from the procedure call. So you
> need to try something like this:
>
> Map parms = new HashMap();
> getSqlMapClientTemplate().update("fetch-ban-policies", parms);
> return parms.get("o");
>
> Jeff Butler
>
--
View this message in context:
http://www.nabble.com/Stored-Procedure-Call-Returns-Empty-List-But-Does-Create-Beans-tf3561741.html#a9948737
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.