Search code examples
dictionaryhashmapmybatisresulttype

Mybatis null value for resultype hashmap


<select id="getData" parameterType="Object" resultType="map"> 
    select query.* from (${query}) query 
</select>

So this is the query I want to execute. Although the query is correct and returning the desired data, but when the data is inserted in the resultType map as specified the null values present in some of the columns get omitted.

I have searched/googled for the same, but not got what I want. I also viewed this link, but can't get my answer.

Is there any way to get those omitted/disappeared values?


Solution

  • There is the setting callSettersOnNulls, see here. The default is false, so no setter will be called on a null value, but you can set it to true.