ibatis中sql in语句的配置

Posted on 2007-08-24 10:00 Jaunt 阅读(3468) 评论(0)  编辑  收藏 所属分类: Ibatis
ibatis中sql in语句的配置?
ibatis中如何配置in语句,需要迭代,不能直接用string的写法


<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>

 

只有注册用户登录后才能发表评论。


网站导航: