ObjectDB ObjectDB

detach(entity) - JPA EntityManager's method

Method
javax.persistence.EntityManager
void detach(
  Object entity
)

Remove the given entity from the persistence context, causing a managed entity to become detached. Unflushed changes made to the entity if any (including removal of the entity), will not be synchronized to the database. Entities which previously referenced the detached entity will continue to reference it.
Parameters:
entity - entity instance
Throws:
IllegalArgumentException - if the instance is not an entity
Since:
JPA 2.0