You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Michał Małecki <mi...@poczta.onet.pl> on 2005/08/19 16:30:01 UTC

errors with iterate and $$

Hello,
I've just switched to datamapper 2.1.5, hoping that i can use list directly
as parameter (and not some confugisng listholder with list property). I
found the following errors (please correct me if I'm wrong)
1) I had first the following iterate
<iterate conjunction="OR" open="(" close=")" prepend="AND" property="value">
I thought that "value" is magic word, saying that I want to use whole
parameter; I got
java.lang.StringIndexOutOfBoundsException: String index out of range: -2
I removed property="value"
the following code worked fine
<iterate conjunction="OR" open="(" close=")" prepend="AND" > <![CDATA[
(#value[].level# = -1]]></iterate>
but when I wanted to use $$
<iterate conjunction="OR" open="(" close=")" prepend="AND" > <![CDATA[
(#value[].level# = -1 OR #value[].level# $value[].levelOperator$ le_level)
]]></iterate>
I got
java.lang.NumberFormatException: For input string: "alue[0"
I changed it to
<iterate conjunction="OR" open="(" close=")" prepend="AND" > <![CDATA[
(#value[].level# = -1 OR #value[].level# $[].levelOperator$ le_level)
]]></iterate>
($value[] changed into $[])
then ibatis instead of taking levelOperator took whole object (ivoked
toString and pasted result)

is there any explanation for such behavoiur?
Regards
Michal Malecki