In the above select query in my mapper file I need to get the resultMap as" /> In the above select query in my mapper file I need to get the resultMap as" /> In the above select query in my mapper file I need to get the resultMap as"/>

resultMap in mybatis , I need to pass a List of Strings as return type. How to do this in the mapper file

539 Views Asked by At
<select id="getXXX" parameterType="java.util.List" resultMap="?">
</select>

In the above select query in my mapper file I need to get the resultMap as a List of Strings. How to implement as default Collection cannot be given directly.

I tried using a plain POJO class with a String variable or a List of String variable but it didnt work out.

1

There are 1 best solutions below

0
Artem S On

If you need to get collection of Integers use the following for example:

<select id="getXXX" resultType="java.lang.Integer">
</select>

If you need to get collection of entities:

<select id="getXXX" resultType="com.domain.YourEntity">
</select>