ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Poitras Christian" <Christian.Poit...@ircm.qc.ca>
Subject RE: Capability to use dynamic sql within iterates
Date Fri, 05 May 2006 13:58:51 GMT
You can download the last version of iBatis from CVS. The problem might
already be solved.
 
If this doesn't work, take a look at issue 281. This may patch your
problem.
http://issues.apache.org/jira/browse/IBATIS-281

________________________________

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


I did some further testing after reading issue 131
http://issues.apache.org/jira/browse/IBATIS-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?
 
Thanks,
Paul

________________________________

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




Hello 
I have read Issue 148 and it looks like I can use dynamic sql within an
iterate tag 
http://issues.apache.org/jira/browse/IBATIS-148
<http://issues.apache.org/jira/browse/IBATIS-148>  


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"
parameterClass="Foo"> 
                select * 
                from foo 
                WHERE   
                <iterate property="myListOfGooObjects" conjunction="AND"
> 
                         EXISTS ( SELECT 1 
                                          FROM bla 
                                          WHERE bla.type = 'X'  
                                                <isNotNull
property="myListOfGooObjects[].id"> 
                                                and ( id =
#myListOfGooObjects[].id#  ) 
                                                </isNotNull> 
                                        )                       
                </iterate> 
        </select> 

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.
	

Mime
View raw message