[
http://issues.apache.org/jira/browse/IBATIS-38?page=comments#action_59473 ]
Clinton Begin commented on IBATIS-38:
-------------------------------------
You guys are using the syntax incorrectly. You can't use #[]# outside of an
iterate tag. There are a number of unit tests confirming this behaviour works
as follows:
<select id="dynamicIterate"
parameterClass="list"
resultClass="testdomain.Account">
select
ACC_ID as id,
ACC_FIRST_NAME as firstName,
ACC_LAST_NAME as lastName,
ACC_EMAIL as emailAddress
from ACCOUNT
WHERE ACC_ID IN
<iterate open="(" close=")" conjunction=",">
#[]#
</iterate>
</select>
Cheers,
Clinton
> Support for arrays or list parameter using "IN" keyword
> -------------------------------------------------------
>
> Key: IBATIS-38
> URL: http://issues.apache.org/jira/browse/IBATIS-38
> Project: iBatis for Java
> Type: New Feature
> Components: SQL Maps
> Environment: Any
> Reporter: Walter So
> Priority: Minor
>
> I have a need for the following kind of query:
> <select id="getAmount" parameterClass="java.util.List" >
> select
> ID, AMOUNT
> from
> TABLE
> where ID IN (#ids#)
> </select>
> To generate:
> select ID, AMOUNT from TABLE where ID IN (1001, 1002, 1003, 1004)
> #ids# can also be int[], String[] or Object[] array. Will there be any
> support for these kinds of parameters? Thanks.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira