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
The following table describes the strategies that Spring Data JDBC offers for detecting whether an entity is new:
436
-
437
-
.Options for detection whether an entity is new in Spring Data JDBC
438
-
[options = "autowidth"]
439
-
|===============
440
-
|Id-Property inspection (the default)|By default, Spring Data JDBC inspects the identifier property of the given entity.
441
-
If the identifier property is `null`, then the entity is assumed to be new. Otherwise, it is assumed to not be new.
442
-
|Implementing `Persistable`|If an entity implements `Persistable`, Spring Data JDBC delegates the new detection to the `isNew(…)` method of the entity.
443
-
See the link:$$https://docs.spring.io/spring-data/data-commons/docs/current/api/index.html?org/springframework/data/domain/Persistable.html$$[Javadoc] for details.
444
-
|Implementing `EntityInformation`|You can customize the `EntityInformation` abstraction used in the `SimpleJdbcRepository` implementation by creating a subclass of `JdbcRepositoryFactory` and overriding the `getEntityInformation(…)` method.
445
-
You then have to register the custom implementation of `JdbcRepositoryFactory` as a Spring bean.
446
-
Note that this should rarely be necessary. See the link:{javadoc-base}org/springframework/data/jdbc/repository/support/JdbcRepositoryFactory.html[Javadoc] for details.
@@ -895,7 +882,7 @@ The following table describes the available events:
895
882
896
883
WARNING: Lifecycle events depend on an `ApplicationEventMulticaster`, which in case of the `SimpleApplicationEventMulticaster` can be configured with a `TaskExecutor`, and therefore gives no guarantees when an Event is processed.
0 commit comments