ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "MCCORMICK, Paul" <Paul.McCORM...@doir.wa.gov.au>
Subject RE: Capability to use dynamic sql within iterates
Date Fri, 05 May 2006 04:07:24 GMT
I did some further testing after reading issue 131
I found that <isEqual> and <isNotEqual> tags work in this situation but
other tags like <isNotNull> do not work.  Has anybody got the
<isNotNull> tag to work in the sistuation below?


From: MCCORMICK, Paul [mailto:Paul.McCORMICK@doir.wa.gov.au] 
Sent: Friday, 5 May 2006 11:23 AM
To: user-java@ibatis.apache.org
Subject: Capability to use dynamic sql within iterates

I have read Issue 148 and it looks like I can use dynamic sql within an
iterate tag 

I have a problem when I set the property on a tag to be a value on the
iterated object.  See "myListOfGooObjects[].id" the below sql. 

        <select id="testIterate" resultClass="java.util.HashMap"
                select * 
                from foo 
                <iterate property="myListOfGooObjects" conjunction="AND"
                         EXISTS ( SELECT 1 
                                          FROM bla 
                                          WHERE bla.type = 'X'  
                                                and ( id =
#myListOfGooObjects[].id#  ) 

Here is the parameter classes used,  getters and setters ommited. 
class Foo { 
    // Contains a list of Goo objects 
    List myListOfGooObjects;  

class Goo { 
    // This is the value that is want to the <idNotNull> tag on. 
    Integer id; 

The error is get is: 
--- Cause: com.ibatis.common.beans.ProbeException: Error getting ordinal
list from JavaBean. Cause java.lang.NumberFormatException: For input
string: ""
Caused by: java.lang.NumberFormatException: For input string: "" 

"DISCLAIMER: This email, including any attachments, is intended only for
use by the addressee(s) and may contain confidential and/or personal
information and may also be the subject of legal privilege. If you are
not the intended recipient, you must not disclose or use the information
contained in it. In this case, please let me know by return email,
delete the message permanently from your system and destroy any copies. 

Before you take any action based upon advice and/or information
contained in this email you should carefully consider the advice and
information and consider obtaining relevant independent advice.

View raw message