select query.* from (${query}) query So this is the query I want to execute. A" /> select query.* from (${query}) query So this is the query I want to execute. A" /> select query.* from (${query}) query So this is the query I want to execute. A"/>

Mybatis null value for resultype hashmap

2.4k Views Asked by At
<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?

1

There are 1 best solutions below

3
Florian Schaetz On BEST ANSWER

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.