ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yee, Richard K, CTR,, DMDCWEST" <Richard.Yee....@osd.pentagon.mil>
Subject RE: problem with Ibatis returning correct number of rows
Date Wed, 13 Jul 2005 19:40:13 GMT
Send us the code where you are outputting the information to the log. You
might have a bug in your code.
 
-Richard
 

-----Original Message-----
From: arun m [mailto:arun_m245@yahoo.com] 
Sent: Wednesday, July 13, 2005 12:24 PM
To: user-java@ibatis.apache.org
Subject: problem with Ibatis returning correct number of rows


Hello there
                 we are implementing ibatis. In one scenario, the code is
getting only one row from the oracle database. I looked at the sql statement
generated by Ibatis. The sql statement gets 2 rows from the database where
as Ibatis gets only one.
 
Allow me to give the peice of code diong this.
 
1. the map
 
<resultMap id="getDetails" class="XXXXBean">
   <result property="Id" column="id" />      
   <result property="Amount" column="amount" />      
  </resultMap>

  <statement id="getDetailsbyId" resultMap="getDetails">
  select 
        id,
       amount
       from
    table       where id = #Id#   
      
  </statement>
 
The java code used to call this is as follows
 
ArrayList invoiceviews = (ArrayList)
getSqlMapClientTemplate().queryForList("getDetailsbyId", Id);
 
I did not want to be too verbose in the email hence I shortened the code. I
can share the entire code, if anybody is interested. But the size of
arraylist returned in the above code is 1. The log4j log shows that Ibatis
generates only one resultset for the query. But if I execute the same query
generated by Ibatis I get 2 rows in oracle db.
 
Has anyone encountered this problem before ?
 
Thanks
Ram.
 
 
 

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Mime
View raw message