Polishing.

Invert condition to trigger exception.

See #3442
This commit is contained in:
Mark Paluch
2024-04-25 11:05:19 +02:00
parent eefbdbf0b0
commit d62d993d8e

View File

@@ -79,7 +79,7 @@ class JpaPersistentEntityImpl<T> extends BasicPersistentEntity<T, JpaPersistentP
super.verify();
JpaPersistentProperty versionProperty = getVersionProperty();
Assert.state(versionProperty != null && versionProperty.isAnnotationPresent(Version.class),
Assert.state(versionProperty == null || !versionProperty.isAnnotationPresent(Version.class),
() -> String.format(INVALID_VERSION_ANNOTATION, versionProperty));
}