DATACMNS-677 - AnnotationBasedPersistentProperty now caches absence of annotations on accessor-only properties.

AnnotationBasedPersistentProperty now also caches the absence of properties that are expressed through accessors only. Previously the absence of a field caused us to skip the registration of the absence in the cache.
This commit is contained in:
Oliver Gierke
2015-04-07 08:39:59 +02:00
parent 1d2ad3f2b4
commit b0211911b5
2 changed files with 28 additions and 3 deletions

View File

@@ -201,8 +201,9 @@ public abstract class AnnotationBasedPersistentProperty<P extends PersistentProp
}
/**
* Returns the annotation found for the current {@link AnnotationBasedPersistentProperty}. Will prefer field
* annotations over ones found at getters or setters.
* Returns the annotation found for the current {@link AnnotationBasedPersistentProperty}. Will prefer getters or
* setters annotations over ones found at the backing field as the former can be used to reconfigure the metadata in
* subclasses.
*
* @param annotationType must not be {@literal null}.
* @return
@@ -229,7 +230,7 @@ public abstract class AnnotationBasedPersistentProperty<P extends PersistentProp
}
}
return field == null ? null : cacheAndReturn(annotationType, AnnotationUtils.getAnnotation(field, annotationType));
return cacheAndReturn(annotationType, field == null ? null : AnnotationUtils.getAnnotation(field, annotationType));
}
/*