Mybatis null value for resulttype hashmap

Mybatis null value for resultype hashmap

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

这就是我要执行的查询。尽管查询是正确的并返回了所需的数据,但是当数据按指定插入到结果类型 map 中时,某些列中存在的空值将被忽略。

我有 searched/googled 同样的,但没有得到我想要的。我也查看了 this link,但无法得到答案。

有什么方法可以得到那些 omitted/disappeared 值吗?

有设置callSettersOnNulls,见here。默认值为 false,因此不会对 null 值调用 setter,但您可以将其设置为 true。