Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<select id="keyEquipmentShiftAutomatedModelData" parameterType="java.util.Map" resultType="java.util.Map">
SELECT ID, SUM(VALUE1 + VALUE2) Total
FROM tableName
GROUP BY ID
</select>

Returns below result in sql

ID, Total
1 (null)


But when returned in Map result in myBatis returns {ID=1} where as Total is missing. How to get the column with null into the result set as well something like this {ID=1,Total=null} or something like this {ID=1,Total=""}
Posted
Updated 4-Jan-16 21:56pm
v3

1 solution

Adding
<settings>
<setting name="callSettersOnNulls" value="true">


mybatis-config.xml fixes the issue if using mybatis 3.2 + version
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900