From: MCCORMICK, Paul [mailto:[EMAIL PROTECTED]
Sent: Friday, 05 May 2006 00:07
To: user-java@ibatis.apache.org
Subject: RE: Capability to use dynamic sql within iterates
From: MCCORMICK, Paul [mailto:[EMAIL PROTECTED]
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
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. |