Posted on 2007-08-24 10:00
Jaunt 閱讀(3473)
評(píng)論(0) 編輯 收藏 所屬分類:
Ibatis
ibatis中sql in語(yǔ)句的配置?
ibatis中如何配置in語(yǔ)句,需要迭代,不能直接用string的寫(xiě)法
<select id="sql_test" parameterclass="myPramBean" resultclass="myResult">
select *from tablewhere name in
<iterate property="ids" conjunction="," close=")" open="(" />
#value[]#
</iterate>
and code=#code#
</select>
myPramBean
{
private String code;
private List ids;
...
}
eg:
<delete id="member.batchDelete" parameterClass="java.util.List">
DELETE FROM member where id IN
<iterate conjunction="," open="(" close=")" >
#value[]#
</iterate>
</delete>