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 intAP_NEWConstants to specify the life cycle state typestatic intAP_NEW_DELETEDConstants to specify the life cycle state typestatic intAP_NEW_FLUSHEDConstants to specify the life cycle state typestatic intAP_NEW_FLUSHED_DELETEDConstants to specify the life cycle state typestatic intAP_NEW_FLUSHED_PENDINGConstants to specify the life cycle state typestatic intAP_NEW_PENDINGConstants to specify the life cycle state typeprotected static intDELETE_OPConstants to specify database operation to be executedstatic intHOLLOWConstants to specify the life cycle state typeprotected static intINSERT_OPConstants to specify database operation to be executedprotected booleanisAutoPersistentprotected booleanisBeforeImageUpdatableprotected booleanisDeletedprotected booleanisDirtyprotected booleanisFlushedprotected booleanisNavigableprotected booleanisNewprotected booleanisPersistentprotected booleanisPersistentInDataStoreprotected booleanisRefreshableprotected booleanisTransactionalprotected static ResourceBundlemessagesI18N message handlerprotected booleanneedMergeprotected booleanneedsRegisterprotected booleanneedsReloadprotected booleanneedsRestoreOnRollbackprotected static intNO_OPConstants to specify database operation to be executedstatic intP_CLEANConstants to specify the life cycle state typestatic intP_DELETEDConstants to specify the life cycle state typestatic intP_DELETED_FLUSHEDConstants to specify the life cycle state typestatic intP_DIRTYConstants to specify the life cycle state typestatic intP_NEWConstants to specify the life cycle state typestatic intP_NEW_DELETEDConstants to specify the life cycle state typestatic intP_NEW_FLUSHEDConstants to specify the life cycle state typestatic intP_NEW_FLUSHED_DELETEDConstants to specify the life cycle state typestatic intP_NON_TXConstants to specify the life cycle state typeprotected intstateTypestatic intTOTALConstants to specify the life cycle state typestatic intTRANSIENTConstants to specify the life cycle state typeprotected static intUPDATE_OPConstants to specify database operation to be executedprotected intupdateAction
-
Constructor Summary
Constructors Constructor Description LifeCycleState()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassertTransaction(boolean transactionActive)LifeCycleStatechangeState(int newStateType)Life Cycle State changestatic LifeCycleStategetLifeCycleState(int state)Returns the LifeCycleState for the state constant.intgetUpdateAction()protected static voidinitLifeCycleState()Initialises the objects.booleanisAutoPersistent()Return whether the object is auto-persistent.booleanisBeforeImageUpdatable()booleanisDeleted()Return whether the object is deleted.booleanisDirty()Return whether the object is dirty, i.e.booleanisNavigable()Return whether the object can dynamically navigate to fields that are not present.booleanisNew()Return whether the object was newly created.booleanisPersistent()Return whether the object is persistent.booleanisPersistentInDataStore()Return whether the object is persistent in data store.booleanisRefreshable()Return whether the object can be refreshed from the database.booleanisTransactional()Return whether the object is transactional.booleanneedMerge()booleanneedsRegister()Return whether the object is registered with the persistence manager.booleanneedsReload(boolean optimistic, boolean nontransactionalRead, boolean transactionActive)booleanneedsRestoreOnRollback(boolean retainValues)intstateType()Returns the type of the life cycle stateStringtoString()LifeCycleStatetransitionCommit(boolean retainValues)LifeCycleStatetransitionDeletePersistent()LifeCycleStatetransitionFlushed()LifeCycleStatetransitionMakePending()LifeCycleStatetransitionMakePersistent()LifeCycleStatetransitionReadField(boolean optimisitic, boolean nontransactionalRead, boolean transactionActive)LifeCycleStatetransitionRefreshPersistent()LifeCycleStatetransitionReload(boolean transactionActive)LifeCycleStatetransitionRollback(boolean retainValues)LifeCycleStatetransitionWriteField(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
-
-