ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject Re: Stored Procedure Call Returns Empty List But Does Create Beans
Date Wed, 11 Apr 2007 20:27:14 GMT

<br><font size=2 face="sans-serif">You forgot to assign a resultMap to
your &lt;procedure&gt; element. Try the following:</font>
<br>
<br><font size=2><tt>&nbsp; &nbsp;&lt;procedure id=&quot;fetch-ban-policies&quot;
parameterMap=&quot;fetch-ban-policies-rs&quot; <b><i>resultMap=&quot;fetch-ban-policies-map&quot;</i></b>&gt;</tt></font>
<br><font size=2 face="sans-serif"><br>
Chris Mathrusse<br>
christopher.mathrusse@sybase.com<br>
Sybase, Inc<br>
One Sybase Drive<br>
Dublin, CA 94568<br>
(925) 236-5553</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Paul Sanders &lt;tendancer@gmail.com&gt;</b>
</font>
<p><font size=1 face="sans-serif">04/11/2007 01:13 PM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
user-java@ibatis.apache.org</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">user-java@ibatis.apache.org</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">Stored Procedure Call Returns
Empty List But Does Create Beans</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt><br>
[Hate to post again so quickly, I used to think I knew what I was doing
in<br>
this space but it seems not.... hopefully someone can help me here and
then<br>
I promise to go away.]<br>
<br>
I have a stored procedure that is just a wrapper around a &quot;SELECT
*&quot; and I<br>
have straight JDBC code that uses it and works. So I'm trying to move to<br>
Spring/iBATIS - my code to execute the query runs but the returned List<br>
object is empty. If I log each constructor call and setter call I get the<br>
appropriate output - the beans are being created, and with the right values,<br>
but somehow aren't being returned in the List. Is this a common beginners<br>
mistake??<br>
<br>
Not sure how much of the code is valuable but here is some...<br>
<br>
public List&lt;BanPolicy&gt;fetchBanPolicies()<br>
{<br>
 &nbsp; return getSqlMapClientTemplate().queryForList(&quot;fetch-ban-policies&quot;);
//<br>
returns empty list<br>
}<br>
<br>
the mapping file...<br>
<br>
 &nbsp;&lt;resultMap class=&quot;BanPolicy&quot; id=&quot;fetch-ban-policies-map&quot;&gt;<br>
 &nbsp; &nbsp; &nbsp; &lt;result property=&quot;banPolicyID&quot;
columnIndex=&quot;1&quot;
javaType=&quot;int&quot; /&gt;<br>
 &nbsp; &nbsp; &nbsp; &lt;result property=&quot;applicationID&quot;
columnIndex=&quot;2&quot;
javaType=&quot;int&quot; /&gt;<br>
 &nbsp; &nbsp; &nbsp; &lt;result property=&quot;minBanCount&quot;
columnIndex=&quot;3&quot;
javaType=&quot;int&quot; /&gt;<br>
 &nbsp; &nbsp; &nbsp; &lt;result property=&quot;maxBanCount&quot;
columnIndex=&quot;4&quot;
javaType=&quot;int&quot; /&gt;<br>
 &nbsp; &nbsp; &nbsp; &lt;result property=&quot;accountBanDays&quot;
columnIndex=&quot;5&quot;
javaType=&quot;float&quot; /&gt;<br>
 &nbsp; &nbsp; &nbsp; &lt;result property=&quot;dnasBanDays&quot;
columnIndex=&quot;6&quot;
javaType=&quot;float&quot; /&gt;<br>
 &nbsp; &nbsp; &nbsp; &lt;result property=&quot;banReasonId&quot;
columnIndex=&quot;7&quot;
javaType=&quot;int&quot; /&gt;<br>
 &nbsp; &lt;/resultMap&gt;<br>
<br>
 &nbsp; &lt;parameterMap id=&quot;fetch-ban-policies-rs&quot; class=&quot;map&quot;&gt;<br>
 &nbsp; &nbsp; &nbsp; &lt;parameter property=&quot;o&quot; javaType=&quot;java.sql.ResultSet&quot;<br>
jdbcType=&quot;ORACLECURSOR&quot; mode=&quot;OUT&quot; resultMap=&quot;fetch-ban-policies-map&quot;
/&gt;<br>
 &nbsp; &lt;/parameterMap&gt;<br>
<br>
 &nbsp; &lt;procedure id=&quot;fetch-ban-policies&quot; parameterMap=&quot;fetch-ban-policies-rs&quot;&gt;<br>
 &nbsp; &nbsp; &nbsp;{ call .getBanPolicies(?) }<br>
 &nbsp; &lt;/procedure&gt;<br>
<br>
and the spring deftn.....<br>
<br>
 &nbsp; &lt;bean id=&quot;banPolicyDAO&quot;<br>
class=&quot;persistence.dao.managers.BanPolicyManager&quot;&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;property name=&quot;sqlMapClient&quot;
ref=&quot;sqlMapClient&quot;/&gt;<br>
 &nbsp; &lt;/bean&gt;<br>
<br>
I'm going to do a hard coded SQL version just to get something working<br>
today....<br>
<br>
Cheers<br>
<br>
Paul<br>
-- <br>
View this message in context: http://www.nabble.com/Stored-Procedure-Call-Returns-Empty-List-But-Does-Create-Beans-tf3561741.html#a9947480<br>
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.<br>
<br>
<br>
</tt></font>
<br>

Mime
View raw message