JPA - Removed Instance

> JPA - Java Persistence API (JPA)

1 - About

A managed entity instance becomes removed by:

If X is a:

  • new entity, it is ignored by the remove operation. However, the remove operation is cascaded to entities referenced by X, if the relationship from X to these other entities is annotated with the cascade=REMOVE or cascade=ALL annotation element value.
  • managed entity, the remove operation causes it to become removed. The remove operation is cascaded to entities referenced by X, if the relationships from X to these other entities is annotated with the cascade=REMOVE or cascade=ALL annotation element value.
  • detached entity, an IllegalArgumentException will be thrown by the remove operation (or the transaction commit will fail).
  • removed entity, it is ignored by the remove operation.

A removed entity X will be removed from the database:

After an entity has been removed, its state (except for generated state) will be that of the entity at the point at which the remove operation was called.

Advertising

3 - Documentation / Reference

jpa/removed.txt · Last modified: 2014/01/25 08:36 by gerardnico