I want to select Collection of Integers as Collection inside Result Map in Mybatis. I am unable to figure out a way for this.
Result class is
class Mapping {
private String name;
private List<Integer> ids;
}
Mybatis is as follows:
<resultMap id="mapping" type="some.package.Mapping">
<result property="name" column="name"/>
<collection property="ids" column="id" javaType="java.util.List" ofType="java.lang.Integer" />
</resultMap>
<select id="getMapping" resultMap="mapping">
SELECT name, id
FROM mapping
</select>
This code in not working out for me. What am I missing?