ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Goel, Sachin" <sachin.g...@fidelity.co.in>
Subject RE: IN - representation in IBATIS
Date Fri, 12 Jan 2007 03:22:36 GMT
You may try this as well(assuming you have an array to be used in IN clause)
 
<dynamic prepend="AND" >

<isNotEmpty property="types"> 

<iterate property="types" open="TYPE  IN (" close=")" conjunction=",">

#types[]#

</iterate> 

</isNotEmpty>

</dynamic> 

 
 

Thanks and Regards 
Sachin Goel 


  _____  

From: Adnan Atic [mailto:Adnan_Atic@hilton.com] 
Sent: Thursday, 11 January 2007 15:36
To: user-java@ibatis.apache.org
Subject: IN - representation in IBATIS


I am not sure how to represent this SQL construct in ibatis sql config files
:
 
SELECT A.* 
    FROM USER A 
 WHERE TYPE IN (?,?,...)
 
Is there something like:
<select id="getUsers" resultMap="userResultMap"
parameterClass="java.util.List">


SELECT A.* 
    FROM USER A 
 WHERE TYPE IN (#types#)

</select>

 

Thanks


Mime
View raw message