private Object getRowValue(ResultSetWrapper rsw, ResultMap resultMap) throws SQLException {
   final ResultLoaderMap lazyLoader = new ResultLoaderMap();
   Object resultObject = createResultObject(rsw, resultMap, lazyLoader, null);
   if (resultObject != null && !typeHandlerRegistry.hasTypeHandler(resultMap.getType())) {
     final MetaObject metaObject = configuration.newMetaObject(resultObject);
     boolean foundValues = resultMap.getConstructorResultMappings().size() > 0;
     if (shouldApplyAutomaticMappings(
         resultMap, !AutoMappingBehavior.NONE.equals(configuration.getAutoMappingBehavior()))) {
       foundValues = applyAutomaticMappings(rsw, resultMap, metaObject, null) || foundValues;
     }
     foundValues =
         applyPropertyMappings(rsw, resultMap, metaObject, lazyLoader, null) || foundValues;
     foundValues = lazyLoader.size() > 0 || foundValues;
     resultObject = foundValues ? resultObject : null;
     return resultObject;
   }
   return resultObject;
 }
 private Object getRowValue(
     ResultSetWrapper rsw,
     ResultMap resultMap,
     CacheKey combinedKey,
     CacheKey absoluteKey,
     String columnPrefix,
     Object partialObject)
     throws SQLException {
   final String resultMapId = resultMap.getId();
   Object resultObject = partialObject;
   if (resultObject != null) {
     final MetaObject metaObject = configuration.newMetaObject(resultObject);
     putAncestor(absoluteKey, resultObject, resultMapId, columnPrefix);
     applyNestedResultMappings(rsw, resultMap, metaObject, columnPrefix, combinedKey, false);
     ancestorObjects.remove(absoluteKey);
   } else {
     final ResultLoaderMap lazyLoader = new ResultLoaderMap();
     resultObject = createResultObject(rsw, resultMap, lazyLoader, columnPrefix);
     if (resultObject != null && !typeHandlerRegistry.hasTypeHandler(resultMap.getType())) {
       final MetaObject metaObject = configuration.newMetaObject(resultObject);
       boolean foundValues = resultMap.getConstructorResultMappings().size() > 0;
       if (shouldApplyAutomaticMappings(
           resultMap, AutoMappingBehavior.FULL.equals(configuration.getAutoMappingBehavior()))) {
         foundValues =
             applyAutomaticMappings(rsw, resultMap, metaObject, columnPrefix) || foundValues;
       }
       foundValues =
           applyPropertyMappings(rsw, resultMap, metaObject, lazyLoader, columnPrefix)
               || foundValues;
       putAncestor(absoluteKey, resultObject, resultMapId, columnPrefix);
       foundValues =
           applyNestedResultMappings(rsw, resultMap, metaObject, columnPrefix, combinedKey, true)
               || foundValues;
       ancestorObjects.remove(absoluteKey);
       foundValues = lazyLoader.size() > 0 || foundValues;
       resultObject = foundValues ? resultObject : null;
     }
     if (combinedKey != CacheKey.NULL_CACHE_KEY)
       nestedResultObjects.put(combinedKey, resultObject);
   }
   return resultObject;
 }