How to use foreach in mybatis mapper? I mean what parameters I should send there?
For example I've got this select statement
<select id="findObjectsWithIds" resultMap="SimpleObjectResult">
SELECT * FROM testschema."XSimpleTable"
WHERE ID in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
I've got interface with method
List<SimpleObject> findObjectsWithIds(List<String> ids);
I've got implementation of the interface
@Override
public List<SimpleObject> findObjectsWithIds(List<String> ids) {
SqlSession sqlSession = MyBatisSqlSessionFactory.openSession();
try {
SimpleMapper simpleMapper = sqlSession.getMapper(SimpleMapper.class);
return simpleMapper.findObjectsWithIds(ids);
} finally {
sqlSession.close();
}
}
And when I make an attempt to run - I've got this error

How to use foreach properly?