ibatis iterate 数组
程序员文章站
2022-05-23 12:56:19
...
It's very simple, however iBATIS documentation does not state this. Suppose you need to issue a query with an IN (....) criterion and you need to pass an array of values into it:
The essential condition for success is - don't specify the parameterClass attribute in select and don't specify property in iterate, otherwise the query won't work.
<select id="getSmth" resultClass="myclass">
select name, body from myclass_table where name in (
<iterate conjunction=",">#[]#</iterate>
)
</select>
The essential condition for success is - don't specify the parameterClass attribute in select and don't specify property in iterate, otherwise the query won't work.
上一篇: 《MFC程序开发参考大全》学习笔记_3
下一篇: 怎样在数组中取最大值