@NoRepositoryBean
public interface DetachableJpaRepository<T,ID extends Serializable>
extends org.springframework.data.jpa.repository.JpaRepository<T,ID>
JpaRepository extension to allow to get detached entities.
This is useful if you want
to make changes to an entity but you don't want those changes to be automatically persisted.
For example, if you have the open session in view option active (by default in Spring Boot),
and you want to use the JPA optimistic locking through the version field, coming from a form
for example, and you want the binding to be performed on a loaded entity, it has to be a detached
one.| Modifier and Type | Method and Description |
|---|---|
T |
findOneDetached(ID id)
Retrieves an entity by its id and detaches it from the EntityManager.
|
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAll, flush, getOne, save, saveAndFlushfindAllT findOneDetached(ID id)
id - must not be null.IllegalArgumentException - if id is nullCopyright © 2018 DISID Corporation. All rights reserved.