ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Ellis <ellis....@gmail.com>
Subject Re: how to pass two different types of values to query in IBATIS
Date Mon, 12 Apr 2010 15:00:21 GMT
2010/4/12 Fran├žois Schiettecatte <fschiettecatte@gmail.com>:
> I think Mukhi is trying to pass a string and an array of numbers, the string being the
entryRefno and the list of nunbers to be added to the IN() clause of the SELECT statement
in the example given.
> The Map is the way to go, you just need to add the string as shows in the code sample
below. The array of numbers is more complicated because I dont think there is way to iterate
over an array in the map xml (correct me if I am wrong here). The way I would handle this
is to turn the array into a comma separated string of numbers and pass that, so in the example
below I would turn the array (90,89,93,45,67) into a string "90,89,93,45,67" and pass that.
Ugly but workable.

The 'foreach' example in the User Guide shows how to iterate over a
collection to build an 'IN' clause from a collection.  There's no need
to build a string.


To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org

View raw message