Skip to content

Commit c23cddd

Browse files
authored
Merge pull request mybatis#1472 from helloyou2012/master
Corrected incorrect attribute name to avoid false positive error.
2 parents 475631d + c2c9b41 commit c23cddd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,12 @@ private String processNestedResultMappings(XNode context, List<ResultMapping> re
413413

414414
protected void validateCollection(XNode context, Class<?> enclosingType) {
415415
if ("collection".equals(context.getName()) && context.getStringAttribute("resultMap") == null
416-
&& context.getStringAttribute("resultType") == null) {
416+
&& context.getStringAttribute("javaType") == null) {
417417
MetaClass metaResultType = MetaClass.forClass(enclosingType, configuration.getReflectorFactory());
418418
String property = context.getStringAttribute("property");
419419
if (!metaResultType.hasSetter(property)) {
420420
throw new BuilderException(
421-
"Ambiguous collection type for property '" + property + "'. You must specify 'resultType' or 'resultMap'.");
421+
"Ambiguous collection type for property '" + property + "'. You must specify 'javaType' or 'resultMap'.");
422422
}
423423
}
424424
}

src/test/java/org/apache/ibatis/submitted/stringlist/StringListTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void shouldFailFastIfCollectionTypeIsAmbiguous() throws Exception {
6565
fail("Should throw exception when collection type is unresolvable.");
6666
} catch (PersistenceException e) {
6767
assertTrue(e.getMessage()
68-
.contains("Ambiguous collection type for property 'groups'. You must specify 'resultType' or 'resultMap'."));
68+
.contains("Ambiguous collection type for property 'groups'. You must specify 'javaType' or 'resultMap'."));
6969
}
7070
}
7171
}

0 commit comments

Comments
 (0)