Author: cbegin Date: Sun Sep 20 13:10:50 2009 New Revision: 817021 URL: http://svn.apache.org/viewvc?rev=817021&view=rev Log: Added code to deal with rows with no values
Modified: ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/NewResultSetHandler.java Modified: ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/NewResultSetHandler.java URL: http://svn.apache.org/viewvc/ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/NewResultSetHandler.java?rev=817021&r1=817020&r2=817021&view=diff ============================================================================== --- ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/NewResultSetHandler.java (original) +++ ibatis/java/ibatis-3/trunk/ibatis-3-core/src/main/java/org/apache/ibatis/executor/resultset/NewResultSetHandler.java Sun Sep 20 13:10:50 2009 @@ -34,6 +34,7 @@ private final ObjectFactory objectFactory; private final Map rowValueCache = new HashMap(); + private static final CacheKey NULL_ROW_KEY = new CacheKey(); public NewResultSetHandler(Executor executor, MappedStatement mappedStatement, ParameterHandler parameterHandler, ResultHandler resultHandler, BoundSql boundSql, int offset, int limit) { this.executor = executor; @@ -186,7 +187,9 @@ applyAutomaticMappings(rs, unmappedColumnNames, metaObject); applyNestedResultMappings(rs, resultMap, metaObject); } - rowValueCache.put(rowKey, resultObject); + if (rowKey != NULL_ROW_KEY) { + rowValueCache.put(rowKey, resultObject); + } return resultObject; } } @@ -469,6 +472,9 @@ } else { createRowKeyForMappedProperties(rs, cacheKey, resultMappings); } + if (cacheKey.getUpdateCount() < 2) { + return NULL_ROW_KEY; + } return cacheKey; }