@ -430,21 +430,8 @@ Embedded entities containing a `Collection` or a `Map` will always be considered
@@ -430,21 +430,8 @@ Embedded entities containing a `Collection` or a `Map` will always be considered
Such an entity will therefore never be `null` even when using @Embedded(onEmpty = USE_NULL).
The following table describes the strategies that Spring Data JDBC offers for detecting whether an entity is new:
.Options for detection whether an entity is new in Spring Data JDBC
[options = "autowidth"]
|===============
|Id-Property inspection (the default)|By default, Spring Data JDBC inspects the identifier property of the given entity.
If the identifier property is `null`, then the entity is assumed to be new. Otherwise, it is assumed to not be new.
|Implementing `Persistable`|If an entity implements `Persistable`, Spring Data JDBC delegates the new detection to the `isNew(…)` method of the entity.
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.
|Implementing `EntityInformation`|You can customize the `EntityInformation` abstraction used in the `SimpleJdbcRepository` implementation by creating a subclass of `JdbcRepositoryFactory` and overriding the `getEntityInformation(…)` method.
You then have to register the custom implementation of `JdbcRepositoryFactory` as a Spring bean.
Note that this should rarely be necessary. See the link:{javadoc-base}org/springframework/data/jdbc/repository/support/JdbcRepositoryFactory.html[Javadoc] for details.
@ -889,7 +876,7 @@ The following table describes the available events:
@@ -889,7 +876,7 @@ The following table describes the available events:
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.