Class LifeCycleState

    • 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
    • Constructor Detail

      • LifeCycleState

        public LifeCycleState()
    • 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)
      • 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