diff --git a/src/main/java/org/springframework/data/mapping/model/AnnotationBasedPersistentProperty.java b/src/main/java/org/springframework/data/mapping/model/AnnotationBasedPersistentProperty.java index e46cb8539..f5cf74c28 100644 --- a/src/main/java/org/springframework/data/mapping/model/AnnotationBasedPersistentProperty.java +++ b/src/main/java/org/springframework/data/mapping/model/AnnotationBasedPersistentProperty.java @@ -65,6 +65,11 @@ public abstract class AnnotationBasedPersistentProperty

isTransient = Lazy.of(() -> super.isTransient() || isAnnotationPresent(Transient.class) || isAnnotationPresent(Value.class) || isAnnotationPresent(Autowired.class)); + private final Lazy writable = Lazy.of(() -> !isTransient() && !isAnnotationPresent(ReadOnlyProperty.class)); + private final Lazy reference = Lazy.of(() -> !isTransient() && isAnnotationPresent(Reference.class)); + private final Lazy isId = Lazy.of(() -> isAnnotationPresent(Id.class)); + private final Lazy isVersion = Lazy.of(() -> isAnnotationPresent(Version.class)); + /** * Creates a new {@link AnnotationBasedPersistentProperty}. * @@ -173,7 +178,7 @@ public abstract class AnnotationBasedPersistentProperty