Class LifeCycleState
- java.lang.Object
-
- com.sun.jdo.spi.persistence.support.sqlstore.state.LifeCycleState
-
- Direct Known Subclasses:
AutoPersistentNew
,AutoPersistentNewDeleted
,Hollow
,PersistentClean
,PersistentDeleted
,PersistentDirty
,PersistentNew
,PersistentNewDeleted
,PersistentNonTransactional
public abstract class LifeCycleState extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
AP_NEW
Constants to specify the life cycle state typestatic int
AP_NEW_DELETED
Constants to specify the life cycle state typestatic int
AP_NEW_FLUSHED
Constants to specify the life cycle state typestatic int
AP_NEW_FLUSHED_DELETED
Constants to specify the life cycle state typestatic int
AP_NEW_FLUSHED_PENDING
Constants to specify the life cycle state typestatic int
AP_NEW_PENDING
Constants to specify the life cycle state typeprotected static int
DELETE_OP
Constants to specify database operation to be executedstatic int
HOLLOW
Constants to specify the life cycle state typeprotected static int
INSERT_OP
Constants to specify database operation to be executedprotected boolean
isAutoPersistent
protected boolean
isBeforeImageUpdatable
protected boolean
isDeleted
protected boolean
isDirty
protected boolean
isFlushed
protected boolean
isNavigable
protected boolean
isNew
protected boolean
isPersistent
protected boolean
isPersistentInDataStore
protected boolean
isRefreshable
protected boolean
isTransactional
protected static ResourceBundle
messages
I18N message handlerprotected boolean
needMerge
protected boolean
needsRegister
protected boolean
needsReload
protected boolean
needsRestoreOnRollback
protected static int
NO_OP
Constants to specify database operation to be executedstatic int
P_CLEAN
Constants to specify the life cycle state typestatic int
P_DELETED
Constants to specify the life cycle state typestatic int
P_DELETED_FLUSHED
Constants to specify the life cycle state typestatic int
P_DIRTY
Constants to specify the life cycle state typestatic int
P_NEW
Constants to specify the life cycle state typestatic int
P_NEW_DELETED
Constants to specify the life cycle state typestatic int
P_NEW_FLUSHED
Constants to specify the life cycle state typestatic int
P_NEW_FLUSHED_DELETED
Constants to specify the life cycle state typestatic int
P_NON_TX
Constants to specify the life cycle state typeprotected int
stateType
static int
TOTAL
Constants to specify the life cycle state typestatic int
TRANSIENT
Constants to specify the life cycle state typeprotected static int
UPDATE_OP
Constants to specify database operation to be executedprotected int
updateAction
-
Constructor Summary
Constructors Constructor Description LifeCycleState()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
assertTransaction(boolean transactionActive)
LifeCycleState
changeState(int newStateType)
Life Cycle State changestatic LifeCycleState
getLifeCycleState(int state)
Returns the LifeCycleState for the state constant.int
getUpdateAction()
protected static void
initLifeCycleState()
Initialises the objects.boolean
isAutoPersistent()
Return whether the object is auto-persistent.boolean
isBeforeImageUpdatable()
boolean
isDeleted()
Return whether the object is deleted.boolean
isDirty()
Return whether the object is dirty, i.e.boolean
isNavigable()
Return whether the object can dynamically navigate to fields that are not present.boolean
isNew()
Return whether the object was newly created.boolean
isPersistent()
Return whether the object is persistent.boolean
isPersistentInDataStore()
Return whether the object is persistent in data store.boolean
isRefreshable()
Return whether the object can be refreshed from the database.boolean
isTransactional()
Return whether the object is transactional.boolean
needMerge()
boolean
needsRegister()
Return whether the object is registered with the persistence manager.boolean
needsReload(boolean optimistic, boolean nontransactionalRead, boolean transactionActive)
boolean
needsRestoreOnRollback(boolean retainValues)
int
stateType()
Returns the type of the life cycle stateString
toString()
LifeCycleState
transitionCommit(boolean retainValues)
LifeCycleState
transitionDeletePersistent()
LifeCycleState
transitionFlushed()
LifeCycleState
transitionMakePending()
LifeCycleState
transitionMakePersistent()
LifeCycleState
transitionReadField(boolean optimisitic, boolean nontransactionalRead, boolean transactionActive)
LifeCycleState
transitionRefreshPersistent()
LifeCycleState
transitionReload(boolean transactionActive)
LifeCycleState
transitionRollback(boolean retainValues)
LifeCycleState
transitionWriteField(boolean transactionActive)
-
-
-
Field Detail
-
messages
protected static final ResourceBundle messages
I18N message handler
-
isPersistent
protected boolean isPersistent
-
isAutoPersistent
protected boolean isAutoPersistent
-
isPersistentInDataStore
protected boolean isPersistentInDataStore
-
isTransactional
protected boolean isTransactional
-
isDirty
protected boolean isDirty
-
isNew
protected boolean isNew
-
isDeleted
protected boolean isDeleted
-
isFlushed
protected boolean isFlushed
-
isNavigable
protected boolean isNavigable
-
isRefreshable
protected boolean isRefreshable
-
isBeforeImageUpdatable
protected boolean isBeforeImageUpdatable
-
needsRegister
protected boolean needsRegister
-
needsReload
protected boolean needsReload
-
needsRestoreOnRollback
protected boolean needsRestoreOnRollback
-
needMerge
protected boolean needMerge
-
updateAction
protected int updateAction
-
stateType
protected int stateType
-
NO_OP
protected static final int NO_OP
Constants to specify database operation to be executed- See Also:
- Constant Field Values
-
INSERT_OP
protected static final int INSERT_OP
Constants to specify database operation to be executed- See Also:
- Constant Field Values
-
UPDATE_OP
protected static final int UPDATE_OP
Constants to specify database operation to be executed- See Also:
- Constant Field Values
-
DELETE_OP
protected static final int DELETE_OP
Constants to specify database operation to be executed- See Also:
- Constant Field Values
-
HOLLOW
public static final int HOLLOW
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
P_NON_TX
public static final int P_NON_TX
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
P_CLEAN
public static final int P_CLEAN
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
P_DIRTY
public static final int P_DIRTY
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
P_NEW
public static final int P_NEW
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
P_NEW_FLUSHED
public static final int P_NEW_FLUSHED
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
P_NEW_FLUSHED_DELETED
public static final int P_NEW_FLUSHED_DELETED
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
P_NEW_DELETED
public static final int P_NEW_DELETED
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
P_DELETED
public static final int P_DELETED
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
P_DELETED_FLUSHED
public static final int P_DELETED_FLUSHED
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
AP_NEW
public static final int AP_NEW
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
AP_NEW_PENDING
public static final int AP_NEW_PENDING
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
AP_NEW_FLUSHED
public static final int AP_NEW_FLUSHED
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
AP_NEW_FLUSHED_PENDING
public static final int AP_NEW_FLUSHED_PENDING
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
AP_NEW_FLUSHED_DELETED
public static final int AP_NEW_FLUSHED_DELETED
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
AP_NEW_DELETED
public static final int AP_NEW_DELETED
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
TRANSIENT
public static final int TRANSIENT
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
TOTAL
public static final int TOTAL
Constants to specify the life cycle state type- See Also:
- Constant Field Values
-
-
Method Detail
-
initLifeCycleState
protected static void initLifeCycleState()
Initialises the objects. This class implements the "state pattern".
-
getLifeCycleState
public static LifeCycleState getLifeCycleState(int state)
Returns the LifeCycleState for the state constant.- Parameters:
state
- the type as integer- Returns:
- the type as LifeCycleState object
-
stateType
public int stateType()
Returns the type of the life cycle state- Returns:
- the type of this life cycle state
-
transitionMakePersistent
public LifeCycleState transitionMakePersistent()
-
transitionDeletePersistent
public LifeCycleState transitionDeletePersistent()
-
transitionRefreshPersistent
public LifeCycleState transitionRefreshPersistent()
-
transitionReload
public LifeCycleState transitionReload(boolean transactionActive)
-
transitionCommit
public LifeCycleState transitionCommit(boolean retainValues)
-
transitionRollback
public LifeCycleState transitionRollback(boolean retainValues)
-
transitionFlushed
public LifeCycleState transitionFlushed()
-
transitionMakePending
public LifeCycleState transitionMakePending()
-
transitionReadField
public LifeCycleState transitionReadField(boolean optimisitic, boolean nontransactionalRead, boolean transactionActive)
-
transitionWriteField
public LifeCycleState transitionWriteField(boolean transactionActive)
-
assertTransaction
protected void assertTransaction(boolean transactionActive)
-
isPersistent
public boolean isPersistent()
Return whether the object is persistent.
-
isAutoPersistent
public boolean isAutoPersistent()
Return whether the object is auto-persistent.
-
isPersistentInDataStore
public boolean isPersistentInDataStore()
Return whether the object is persistent in data store.
-
isTransactional
public boolean isTransactional()
Return whether the object is transactional.
-
isDirty
public boolean isDirty()
Return whether the object is dirty, i.e. has been changed (created, updated, deleted) in this Tx.
-
isNew
public boolean isNew()
Return whether the object was newly created.
-
isDeleted
public boolean isDeleted()
Return whether the object is deleted.
-
needsRegister
public boolean needsRegister()
Return whether the object is registered with the persistence manager.
-
isNavigable
public boolean isNavigable()
Return whether the object can dynamically navigate to fields that are not present.
-
isRefreshable
public boolean isRefreshable()
Return whether the object can be refreshed from the database.
-
isBeforeImageUpdatable
public boolean isBeforeImageUpdatable()
-
needsReload
public boolean needsReload(boolean optimistic, boolean nontransactionalRead, boolean transactionActive)
-
needsRestoreOnRollback
public boolean needsRestoreOnRollback(boolean retainValues)
-
needMerge
public boolean needMerge()
-
getUpdateAction
public int getUpdateAction()
-
changeState
public LifeCycleState changeState(int newStateType)
Life Cycle State change
-
-