public abstract class LifeCycleState extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DETACHED_CLEAN
Detached-Clean
|
static int |
DETACHED_DIRTY
Detached-Dirty
|
static int |
HOLLOW
Hollow
|
static int |
ILLEGAL_STATE
illegal state
|
protected boolean |
isDeleted |
protected boolean |
isDirty |
protected boolean |
isNew |
protected boolean |
isPersistent |
protected boolean |
isTransactional |
static int |
P_CLEAN
Persistent-Clean
|
static int |
P_DELETED
Persistent-Deleted
|
static int |
P_DIRTY
Persistent-Dirty
|
static int |
P_NEW
Persistent-New
|
static int |
P_NEW_DELETED
Persistent-New-Deleted
|
static int |
P_NONTRANS
Persistent-NonTransactional
|
static int |
P_NONTRANS_DIRTY
Persistent-NonTransactionalDirty
|
protected int |
stateType |
static int |
T_CLEAN
Transaction-Clean
|
static int |
T_DIRTY
Transaction-Dirty
|
static int |
TOTAL
total number of states
|
static int |
TRANSIENT
transient
|
Constructor and Description |
---|
LifeCycleState() |
Modifier and Type | Method and Description |
---|---|
protected LifeCycleState |
changeState(ObjectProvider op,
int newStateType)
Utility to change state to a new state.
|
protected LifeCycleState |
changeTransientState(ObjectProvider op,
int newStateType)
Utility to change state to a new state.
|
boolean |
isDeleted()
Return whether the object is deleted.
|
boolean |
isDirty()
Return whether the object is dirty, ie has been changed
(created, updated, deleted) in this Tx.
|
boolean |
isNew()
Return whether the object was newly created.
|
boolean |
isPersistent()
Return whether the object is persistent.
|
boolean |
isTransactional()
Return whether the object is transactional.
|
int |
stateType()
Returns the type of the life cycle state
|
abstract String |
toString()
Method to return a string version of this object.
|
LifeCycleState |
transitionAttach(ObjectProvider op)
Method to transition to persistent-clean.
|
LifeCycleState |
transitionBegin(ObjectProvider op,
Transaction tx)
Method to transition to transaction begin state.
|
LifeCycleState |
transitionCommit(ObjectProvider op,
Transaction tx)
Method to transition to commit state.
|
LifeCycleState |
transitionDeletePersistent(ObjectProvider op)
Method to transition to delete persistent state.
|
LifeCycleState |
transitionDetach(ObjectProvider op)
Method to transition to detached-clean.
|
LifeCycleState |
transitionEvict(ObjectProvider op)
Method to transition to evict state.
|
LifeCycleState |
transitionMakeNontransactional(ObjectProvider op)
Method to transition to nontransactional state.
|
LifeCycleState |
transitionMakePersistent(ObjectProvider op)
Method to transition to persistent state.
|
LifeCycleState |
transitionMakeTransactional(ObjectProvider op,
boolean refreshFields)
Method to transition to transactional state.
|
LifeCycleState |
transitionMakeTransient(ObjectProvider op,
boolean useFetchPlan,
boolean detachAllOnCommit)
Method to transition to transient state.
|
LifeCycleState |
transitionReadField(ObjectProvider op,
boolean isLoaded)
Method to transition to read-field state.
|
LifeCycleState |
transitionRefresh(ObjectProvider op)
Method to transition to refresh state.
|
LifeCycleState |
transitionRetrieve(ObjectProvider op,
boolean fgOnly)
Method to transition to retrieve state.
|
LifeCycleState |
transitionRetrieve(ObjectProvider op,
FetchPlan fetchPlan)
Method to transition to retrieve state.
|
LifeCycleState |
transitionRollback(ObjectProvider op,
Transaction tx)
Method to transition to rollback state.
|
LifeCycleState |
transitionSerialize(ObjectProvider op)
Method to transition when serialised.
|
LifeCycleState |
transitionWriteField(ObjectProvider op)
Method to transition to write-field state.
|
public static final int TRANSIENT
public static final int P_NEW
public static final int P_CLEAN
public static final int P_DIRTY
public static final int HOLLOW
public static final int T_CLEAN
public static final int T_DIRTY
public static final int P_NEW_DELETED
public static final int P_DELETED
public static final int P_NONTRANS
public static final int P_NONTRANS_DIRTY
public static final int DETACHED_CLEAN
public static final int DETACHED_DIRTY
public static final int TOTAL
public static final int ILLEGAL_STATE
protected boolean isDirty
protected boolean isNew
protected boolean isDeleted
protected boolean isTransactional
protected boolean isPersistent
protected int stateType
public final int stateType()
protected final LifeCycleState changeState(ObjectProvider op, int newStateType)
op
- ObjectProvidernewStateType
- The new stateprotected final LifeCycleState changeTransientState(ObjectProvider op, int newStateType)
op
- ObjectProvidernewStateType
- The new statepublic LifeCycleState transitionMakePersistent(ObjectProvider op)
op
- ObjectProvider.public LifeCycleState transitionDeletePersistent(ObjectProvider op)
op
- ObjectProvider.public LifeCycleState transitionMakeTransactional(ObjectProvider op, boolean refreshFields)
op
- ObjectProvider.refreshFields
- Whether to refresh loaded fieldspublic LifeCycleState transitionMakeNontransactional(ObjectProvider op)
op
- ObjectProvider.public LifeCycleState transitionMakeTransient(ObjectProvider op, boolean useFetchPlan, boolean detachAllOnCommit)
op
- ObjectProvider.useFetchPlan
- to make transient the fields in the fetch plandetachAllOnCommit
- Whether to detach on commitpublic LifeCycleState transitionBegin(ObjectProvider op, Transaction tx)
op
- ObjectProvider.tx
- Transaction.public LifeCycleState transitionCommit(ObjectProvider op, Transaction tx)
op
- ObjectProvider.tx
- the Transaction been committed.public LifeCycleState transitionRollback(ObjectProvider op, Transaction tx)
op
- ObjectProvider.tx
- Transaction.public LifeCycleState transitionRefresh(ObjectProvider op)
op
- ObjectProvider.public LifeCycleState transitionEvict(ObjectProvider op)
op
- ObjectProvider.public LifeCycleState transitionReadField(ObjectProvider op, boolean isLoaded)
op
- ObjectProvider.isLoaded
- if the field was previously loadedpublic LifeCycleState transitionWriteField(ObjectProvider op)
op
- ObjectProvider.public LifeCycleState transitionRetrieve(ObjectProvider op, boolean fgOnly)
op
- ObjectProvider.fgOnly
- only retrieve the current fetch group fieldspublic LifeCycleState transitionRetrieve(ObjectProvider op, FetchPlan fetchPlan)
op
- ObjectProvider.fetchPlan
- the fetch plan to load fieldspublic LifeCycleState transitionDetach(ObjectProvider op)
op
- ObjectProvider.public LifeCycleState transitionAttach(ObjectProvider op)
op
- ObjectProvider.public LifeCycleState transitionSerialize(ObjectProvider op)
op
- ObjectProviderpublic final boolean isDirty()
public final boolean isNew()
public final boolean isDeleted()
public final boolean isTransactional()
public final boolean isPersistent()
Copyright © 2019. All rights reserved.