diff --git a/src/main/java/org/apache/ibatis/builder/xml/XMLMapperBuilder.java b/src/main/java/org/apache/ibatis/builder/xml/XMLMapperBuilder.java index a213b2f8568..b5701a9c800 100644 --- a/src/main/java/org/apache/ibatis/builder/xml/XMLMapperBuilder.java +++ b/src/main/java/org/apache/ibatis/builder/xml/XMLMapperBuilder.java @@ -413,12 +413,12 @@ private String processNestedResultMappings(XNode context, List re protected void validateCollection(XNode context, Class enclosingType) { if ("collection".equals(context.getName()) && context.getStringAttribute("resultMap") == null - && context.getStringAttribute("resultType") == null) { + && context.getStringAttribute("javaType") == null) { MetaClass metaResultType = MetaClass.forClass(enclosingType, configuration.getReflectorFactory()); String property = context.getStringAttribute("property"); if (!metaResultType.hasSetter(property)) { throw new BuilderException( - "Ambiguous collection type for property '" + property + "'. You must specify 'resultType' or 'resultMap'."); + "Ambiguous collection type for property '" + property + "'. You must specify 'javaType' or 'resultMap'."); } } } diff --git a/src/test/java/org/apache/ibatis/submitted/stringlist/StringListTest.java b/src/test/java/org/apache/ibatis/submitted/stringlist/StringListTest.java index 04027374ebd..4a996c94f41 100644 --- a/src/test/java/org/apache/ibatis/submitted/stringlist/StringListTest.java +++ b/src/test/java/org/apache/ibatis/submitted/stringlist/StringListTest.java @@ -65,7 +65,7 @@ void shouldFailFastIfCollectionTypeIsAmbiguous() throws Exception { fail("Should throw exception when collection type is unresolvable."); } catch (PersistenceException e) { assertTrue(e.getMessage() - .contains("Ambiguous collection type for property 'groups'. You must specify 'resultType' or 'resultMap'.")); + .contains("Ambiguous collection type for property 'groups'. You must specify 'javaType' or 'resultMap'.")); } } }