You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/asciidoc/is-new-state-detection.adoc
+3-3
Original file line number
Diff line number
Diff line change
@@ -6,12 +6,12 @@ The following table describes the strategies that Spring Data offers for detecti
6
6
.Options for detection whether an entity is new in Spring Data
7
7
[options = "autowidth",cols="1,1"]
8
8
|===
9
-
|Id-Property inspection (the default)
9
+
|`@Id`-Property inspection (the default)
10
10
|By default, Spring Data inspects the version property of the given entity.
11
11
If the identifier property is `null` or `0` in case of primitive types, then the entity is assumed to be new.
12
12
Otherwise, it is assumed to not be new.
13
13
14
-
|Version-Property inspection
14
+
|`@Version`-Property inspection
15
15
|If a property annotated with `@Version` is present and `null`, or in case of a version property of primitive type `0` the entity is considered new.
16
16
If the version property is present but has a different value, the entity is considered to not be new.
17
17
If no version property is present Spring Data falls back to inspection of the Id-Property.
@@ -23,7 +23,7 @@ See the link:https://docs.spring.io/spring-data/data-commons/docs/current/api/in
23
23
_Note: Properties of `Persistable` will get detected and persisted if you use `AccessType.PROPERTY`.
24
24
To avoid that, use `@Transient`._
25
25
26
-
|Implementing `EntityInformation`
26
+
|Providing a custom `EntityInformation` implementation
27
27
|You can customize the `EntityInformation` abstraction used in the repository base implementation by creating a subclass of the module specific repository factory and overriding the `getEntityInformation(…)` method.
28
28
You then have to register the custom implementation of module specific repository factory as a Spring bean.
0 commit comments