DATACMNS-320 - Be less restrictive in finding mapping ambiguities.

So far we threw exceptions in case we find the same exception on getters *and* setters. We now allow this scenario in case the annotations are semantically equivalent.
This commit is contained in:
Oliver Gierke
2013-04-25 15:13:42 +02:00
parent 454defc637
commit 0cf875b358
2 changed files with 13 additions and 2 deletions

View File

@@ -82,7 +82,7 @@ public abstract class AnnotationBasedPersistentProperty<P extends PersistentProp
Class<? extends Annotation> annotationType = annotation.annotationType();
if (annotationCache.containsKey(annotationType)) {
if (annotationCache.containsKey(annotationType) && !annotationCache.get(annotationType).equals(annotation)) {
throw new MappingException(String.format("Ambiguous mapping! Annotation %s configured "
+ "multiple times on accessor methods of property %s in class %s!", annotationType, getName(), getOwner()
.getType().getName()));