Skip to content

Commit 800f852

Browse files
committed
Cleanup.
1 parent b5cf787 commit 800f852

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,11 @@ private boolean applyPropertyMappings(ResultSetWrapper rsw, ResultMap resultMap,
431431
} else if (value == DEFERED) {
432432
foundValues = true;
433433
continue;
434-
} else if (value != null) {
434+
}
435+
if (value != null) {
435436
foundValues = true;
436-
metaObject.setValue(property, value);
437-
} else if (configuration.isCallSettersOnNulls() && !metaObject.getSetterType(property).isPrimitive()) {
437+
}
438+
if (value != null || (configuration.isCallSettersOnNulls() && !metaObject.getSetterType(property).isPrimitive())) {
438439
// gcode issue #377, call setter on nulls (value is not 'found')
439440
metaObject.setValue(property, value);
440441
}
@@ -502,8 +503,8 @@ private boolean applyAutomaticMappings(ResultSetWrapper rsw, ResultMap resultMap
502503
final Object value = mapping.typeHandler.getResult(rsw.getResultSet(), mapping.column);
503504
if (value != null) {
504505
foundValues = true;
505-
metaObject.setValue(mapping.property, value);
506-
} else if (configuration.isCallSettersOnNulls() && !mapping.primitive) {
506+
}
507+
if (value != null || (configuration.isCallSettersOnNulls() && !mapping.primitive)) {
507508
// gcode issue #377, call setter on nulls (value is not 'found')
508509
metaObject.setValue(mapping.property, value);
509510
}

0 commit comments

Comments
 (0)