EntityState (enum)

Enumerates the state of an entity.

API

EntityState.java
enum EntityState {
  NOT_PERSISTABLE     (1)
  SNAPSHOT     (2)
  SNAPSHOT_NO_OID     (3)
  ATTACHED     (4)
  ATTACHED_NO_OID     (5)
  DETACHED     (6)
  HOLLOW     (7)
  TRANSIENT_OR_REMOVED     (8)
  REMOVED     (9)
  boolean isPersistable()     (10)
  boolean isAttached()     (11)
  boolean isAttachedNoOid()     (12)
  boolean isDetached()     (13)
  boolean isHollow()     (14)
  boolean isTransientOrRemoved()     (15)
  boolean isRemoved()     (16)
  boolean isAttachedOrRemoved()
}
1 NOT_PERSISTABLE

Object with this state is not an entity (for example it might be a view model, value type or a domain service).

2 SNAPSHOT

Object with this state is an entity that has no session.

3 SNAPSHOT_NO_OID

Object with this state is an entity that has no session and has no OID yet. On pre-store.

4 ATTACHED

Object with this state is an entity that is attached to a persistence session, in other words changes to the entity will be flushed back to the database.

5 ATTACHED_NO_OID

Is attached, has no OID yet. On pre-store.

6 DETACHED

Is detached, hence (per definition) has an OID.

7 HOLLOW

deprecated:

  • This entity state is no longer in use; was specific to JDO/DataNucleus object store, now retired.

8 TRANSIENT_OR_REMOVED

Object with this state is an entity that is transient or has been removed from the database. Objects in this state may no longer be interacted with.

9 REMOVED

deprecated:

  • This entity state is no longer in use; was specific to JDO/DataNucleus object store, now retired.

10 isPersistable()

Object is an entity, hence is persistable to the database.

11 isAttached()
12 isAttachedNoOid()
13 isDetached()
14 isHollow()
15 isTransientOrRemoved()
16 isRemoved()

Members

NOT_PERSISTABLE

Object with this state is not an entity (for example it might be a view model, value type or a domain service).

SNAPSHOT

Object with this state is an entity that has no session.

SNAPSHOT_NO_OID

Object with this state is an entity that has no session and has no OID yet. On pre-store.

ATTACHED

Object with this state is an entity that is attached to a persistence session, in other words changes to the entity will be flushed back to the database.

ATTACHED_NO_OID

Is attached, has no OID yet. On pre-store.

DETACHED

Is detached, hence (per definition) has an OID.

HOLLOW

deprecated:

  • This entity state is no longer in use; was specific to JDO/DataNucleus object store, now retired.

TRANSIENT_OR_REMOVED

Object with this state is an entity that is transient or has been removed from the database. Objects in this state may no longer be interacted with.

REMOVED

deprecated:

  • This entity state is no longer in use; was specific to JDO/DataNucleus object store, now retired.

isPersistable()

Object is an entity, hence is persistable to the database.

isAttached()

isAttachedNoOid()

isDetached()

isHollow()

isTransientOrRemoved()

isRemoved()