<iterate
Property= ""/* optional, use the property name in the passed-in parameter collection to get the value, this must be a list type, otherwise it will appear outofrangeexception, usually the parameter uses JAVA.UTIL.MAP is used only if the passed in parameter itself is a java.util.List and cannot be used only with this property. /
Conjunction= ""/* optional, iterate can be seen as a loop that specifies the symbols added after each loop , such as making each loop or, set this property to or*/
Open= ""/* optional, looping start symbol */
Close= ""/* optional, Loop end symbol */
Prepend= ""/* optional, plus the symbol before the open specified symbol */
>
1. Enquiry
<!--iterate, queries based on multiple matching criteria, like in (a,b,c)--
<select id= "Selectbyiterate" parameterclass= "java.util.List" resultclass= "User" >
SELECT * from the USERS WHERE user_id in
<iterate conjunction= "," open= "(" close= ")" >
#ids []#
</iterate>
</select>
Note: Do not attribute property, otherwise error. String index out of range: 1
2. However, if the parameter has multiple incoming one is list, the other is not, Parameterclass is a map, the property attribute is required to differentiate the collection to traverse.
2. Delete
<!--Bulk Delete objects, iterate do not property properties--
<delete id= "Delstudybook" parameterclass= "Java.util.List" >
Delete from Studybook WHERE ID in
<iterate conjunction= "," open= "(" close= ")" >
#bookList []#
</iterate>
</delete>
http://hongzhguan.iteye.com/blog/1222353
Ibatis realization of the use of iterate