JPA - Removed Instance

Card Puncher Data Processing

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.

Documentation / Reference





Discover More
Card Puncher Data Processing
JPA - Entity (Operations|Lifecycle)

All entity operations are described in the chapter 3: Entity Operations of the specification The following operations are possible: PERSIST, MERGE, REMOVE, REFRESH, DETACH FLUSH This...
Card Puncher Data Processing
JPA - Transaction

The managed entities of: a transaction-scoped persistence context become detached when the transaction commits. an extended persistence context remain managed. For both transaction-scoped and...



Share this page:
Follow us:
Task Runner