@@ -145,20 +145,22 @@ private boolean applyNestedResultMappings(ResultSet rs, ResultMap resultMap, Met
145
145
final CacheKey combinedKey = combineKeys (rowKey , parentRowKey );
146
146
Object rowValue = objectCache .get (combinedKey );
147
147
boolean knownValue = (rowValue != null );
148
- rowValue = getRowValue (rs , nestedResultMap , combinedKey , rowKey , columnPrefix , resultColumnCache , rowValue );
149
- final Object collectionProperty = instantiateCollectionPropertyIfAppropriate (resultMapping , metaObject );
150
- if (rowValue != null && !knownValue && anyNotNullColumnHasValue (resultMapping , columnPrefix , rs )) {
151
- if (collectionProperty != null ) {
152
- final MetaObject targetMetaObject = configuration .newMetaObject (collectionProperty );
153
- targetMetaObject .add (rowValue );
154
- } else {
155
- if (!newObject ) {
156
- throw new ExecutorException ("Trying to overwrite a previous set value for the association '" + resultMapping .getProperty ()
157
- + "'. Check your id/result elements to ensure they identify uniquely an record." );
148
+ final Object collectionProperty = instantiateCollectionPropertyIfAppropriate (resultMapping , metaObject );
149
+ if (anyNotNullColumnHasValue (resultMapping , columnPrefix , rs )) {
150
+ rowValue = getRowValue (rs , nestedResultMap , combinedKey , rowKey , columnPrefix , resultColumnCache , rowValue );
151
+ if (rowValue != null && !knownValue ) {
152
+ if (collectionProperty != null ) {
153
+ final MetaObject targetMetaObject = configuration .newMetaObject (collectionProperty );
154
+ targetMetaObject .add (rowValue );
155
+ } else {
156
+ if (!newObject ) {
157
+ throw new ExecutorException ("Trying to overwrite a previous set value for the association '" + resultMapping .getProperty ()
158
+ + "'. Check your id/result elements to ensure they identify uniquely an record." );
159
+ }
160
+ metaObject .setValue (resultMapping .getProperty (), rowValue );
158
161
}
159
- metaObject . setValue ( resultMapping . getProperty (), rowValue ) ;
162
+ foundValues = true ;
160
163
}
161
- foundValues = true ;
162
164
}
163
165
}
164
166
} catch (SQLException e ) {
0 commit comments