Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,12 @@ private String processNestedResultMappings(XNode context, List<ResultMapping> 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'.");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'."));
}
}
}