In mybatis passing array list is as simple as passing a map into
please follow the below codes
Any Dao method like
List<domain.blog.Post> selectPostIn ( List<String> params );
And the Dao.xml
You can pass a List instance or an Array to MyBatis as a parameter object. When you do, MyBatis will automatically wrap it in a Map, and key it by name. List instances will be keyed to the name “list” and array instances will be keyed to the name “array”
I have tried with list its working
please follow the below codes
Any Dao method like
List<domain.blog.Post> selectPostIn ( List<String> params );
And the Dao.xml
<select id="selectPostIn" resultType="domain.blog.Post" parameterType="java.util.List">Just make sure collection name should be "list" only
SELECT * FROM POST P WHERE ID in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</select>
You can pass a List instance or an Array to MyBatis as a parameter object. When you do, MyBatis will automatically wrap it in a Map, and key it by name. List instances will be keyed to the name “list” and array instances will be keyed to the name “array”
I have tried with list its working