ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rashmi Dixit" <rash...@gmail.com>
Subject iterate over java.Util.List
Date Wed, 14 Jun 2006 12:53:17 GMT
Hi,

I have a select statement to which I want to attach a where clause with
an "IN". The values for the IN are BigDecimals which I would like to
pass as a java.util.List. (Note: I know this list will not be empty,
will be adding dynamic prepend later).

<select id="trial" resultMap="uploadQueueResult"
parameterClass="java.util.List">
        select ID from sometable
	  WHERE 
     		<iterate property="list" 
     			open="FACILITYID in ("
     			close=")"
     			conjunction=",">
     			#list[]#				 
     		</iterate>
</select>

I am getting an error when I execute this

--- Check the parameter map.  
--- Cause: java.lang.StringIndexOutOfBoundsException: String index out
of range: -2

What am I doing wrong here? Even if I use "value" instead of "list" as
the property value, I get the same exception. I haven't been able to
find enough iterate examples even after a google search. All examples
iterate over some property of the parameter class or a Map.

Any help will be appreciated.

Regards
~Rashmi
     




Mime
View raw message