It would be nice to mention it in the ref doc, especially because we can't debug those classes to find out how they work (because proxies are generated at startup time).
Here is an email that Oliver sent me on this topic, guessing that it will save some time for the ref doc:
See [0]. By default this can be customized implementing Persistable with your domain class which exposes an ....isNew() method. If you need more advanced usecases, you can implement the EntityInformation abstraction used in the repo implementation by customizing the repository factory [1], but that should be rerely needed.
Michael Isvy opened DATAJPA-344 and commented
I understand that by default, generated save methods do something like that:
It would be nice to mention it in the ref doc, especially because we can't debug those classes to find out how they work (because proxies are generated at startup time). Here is an email that Oliver sent me on this topic, guessing that it will save some time for the ref doc:
See [0]. By default this can be customized implementing Persistable with your domain class which exposes an ....isNew() method. If you need more advanced usecases, you can implement the EntityInformation abstraction used in the repo implementation by customizing the repository factory [1], but that should be rerely needed.
Cheers, Ollie
[0] https://github.com/SpringSource/spring-data-jpa/blob/master/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java#L352 [1] https://github.com/SpringSource/spring-data-jpa/blob/master/src/main/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactory.java#L144
No further details from DATAJPA-344