@@ -149,16 +149,16 @@ private boolean applyNestedResultMappings(ResultSet rs, ResultMap resultMap, Met
149
149
try {
150
150
final StringBuilder columnPrefixBuilder = new StringBuilder ();
151
151
if (parentPrefix != null ) columnPrefixBuilder .append (parentPrefix );
152
- if (resultMapping .getColumnPrefix ()!= null ) columnPrefixBuilder .append (resultMapping .getColumnPrefix ());
152
+ if (resultMapping .getColumnPrefix () != null ) columnPrefixBuilder .append (resultMapping .getColumnPrefix ());
153
153
final String columnPrefix = columnPrefixBuilder .length () == 0 ? null : columnPrefixBuilder .toString ().toUpperCase (Locale .ENGLISH );
154
154
final ResultMap nestedResultMap = getNestedResultMap (rs , nestedResultMapId , columnPrefix );
155
- final Object collectionProperty = instantiateCollectionPropertyIfAppropriate (resultMapping , metaObject );
156
155
final CacheKey absoluteKey = createAbsoluteKey (nestedResultMap , rs , columnPrefix , resultColumnCache );
157
156
final CacheKey combinedKey = getCombinedKey (absoluteKey , parentRowKey );
158
157
final boolean knownValue = objectCache .containsKey (combinedKey );
159
158
final boolean isAncestor = ancestorCache .containsKey (absoluteKey );
160
159
Object rowValue = getRowValue (rs , nestedResultMap , combinedKey , absoluteKey , columnPrefix , resultColumnCache );
161
160
if (!knownValue && rowValue != null && anyNotNullColumnHasValue (resultMapping , columnPrefix , rs )) {
161
+ final Object collectionProperty = instantiateCollectionPropertyIfAppropriate (resultMapping , metaObject );
162
162
if (collectionProperty != null ) {
163
163
final MetaObject targetMetaObject = configuration .newMetaObject (collectionProperty );
164
164
targetMetaObject .add (rowValue );
0 commit comments