Enum Class Entity.State
- All Implemented Interfaces:
Serializable
,Comparable<Entity.State>
,Constable
- Enclosing interface:
Entity
The current state of the in-memory representation of an entity in respect of the
database.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe entity has been loaded from the database including all data and hasn't been changed, or was just created and persisted, ie its in-memory representation is in sync with the database.The entity has been created in memory but isn't written to the database yet.The entity has been loaded from the database including all data and its in-memory representation has uncommitted changes.The entity has been loaded from the database, but the data hasn't been fetched yet.The object has been invalidated and cannot be used anymore.The entity has been deleted from the database, this in-memory representation is just a phantom of an entity that doesn't exist anymore. -
Method Summary
Modifier and TypeMethodDescriptionboolean
physical()
boolean
usable()
static Entity.State
Returns the enum constant of this class with the specified name.static Entity.State[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CONCEPTION
The entity has been created in memory but isn't written to the database yet. Such objects have no ID. -
HOLLOW
The entity has been loaded from the database, but the data hasn't been fetched yet. This will happen on the next read or write access. -
CLEAN
The entity has been loaded from the database including all data and hasn't been changed, or was just created and persisted, ie its in-memory representation is in sync with the database. -
DIRTY
The entity has been loaded from the database including all data and its in-memory representation has uncommitted changes. -
PHANTOM
The entity has been deleted from the database, this in-memory representation is just a phantom of an entity that doesn't exist anymore. -
INVALID
The object has been invalidated and cannot be used anymore. This can happen due tue a failed second phase of a commit or explicit invalidation of the cache.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
usable
public boolean usable() -
physical
public boolean physical()
-