Skip to content

Commit 16059df

Browse files
committed
removed unnecessary enums
1 parent cc7a981 commit 16059df

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/main/java/org/apache/ibatis/builder/xml/XMLMapperBuilder.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,6 @@ private ResultMapping buildResultMappingFromContext(XNode context, Class<?> resu
358358
String notNullColumn = context.getStringAttribute("notNullColumn");
359359
String columnPrefix = context.getStringAttribute("columnPrefix");
360360
String typeHandler = context.getStringAttribute("typeHandler");
361-
if ("association".equals(context.getName())) {
362-
flags.add(ResultFlag.ASSOCIATION);
363-
} else if ("collection".equals(context.getName())) {
364-
flags.add(ResultFlag.COLLECTION);
365-
}
366361
Class<?> javaTypeClass = resolveClass(javaType);
367362
@SuppressWarnings("unchecked")
368363
Class<? extends TypeHandler<?>> typeHandlerClass = (Class<? extends TypeHandler<?>>) resolveClass(typeHandler);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,14 @@ private boolean applyNestedResultMappings(ResultSet rs, ResultMap resultMap, Met
156156
final CacheKey absoluteKey = createAbsoluteKey(nestedResultMap, rs, columnPrefix, resultColumnCache);
157157
final CacheKey combinedKey = getCombinedKey(absoluteKey, parentRowKey);
158158
final boolean knownValue = objectCache.containsKey(combinedKey);
159+
final boolean isAncestor = ancestorCache.containsKey(absoluteKey);
159160
Object rowValue = getRowValue(rs, nestedResultMap, combinedKey, absoluteKey, columnPrefix, resultColumnCache);
160161
if (!knownValue && rowValue != null && anyNotNullColumnHasValue(resultMapping, columnPrefix, rs)) {
161162
if (collectionProperty != null) {
162163
final MetaObject targetMetaObject = configuration.newMetaObject(collectionProperty);
163164
targetMetaObject.add(rowValue);
164165
} else {
165-
if (!parentIsNew && !ancestorCache.containsKey(absoluteKey)) {
166+
if (!parentIsNew && !isAncestor) {
166167
throw new ExecutorException("Trying to set a 1 to 1 child element twice for '" + resultMapping.getProperty() + "'. Check your id properties.");
167168
}
168169
metaObject.setValue(resultMapping.getProperty(), rowValue);

src/main/java/org/apache/ibatis/mapping/ResultFlag.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
package org.apache.ibatis.mapping;
1717

1818
public enum ResultFlag {
19-
ID, CONSTRUCTOR, COLLECTION, ASSOCIATION
19+
ID, CONSTRUCTOR
2020
}

0 commit comments

Comments
 (0)