Methods Summary |
---|
protected void | assertTransaction(boolean transactionActive)
if (!transactionActive) {
throw new JDOUserException(I18NHelper.getMessage(messages,
"jdo.lifecycle.xactnotactive")); // NOI18N
}
|
public com.sun.jdo.spi.persistence.support.sqlstore.state.LifeCycleState | changeState(int newStateType)/
/**
Life Cycle State change
if (logger.isLoggable(Logger.FINER)) {
Object[] items = new Object[] {this,stateTypes[newStateType]};
logger.finer("sqlstore.state.lifecyclestate.changestate",items); // NOI18N
}
return (stateTypes[newStateType]);
|
public static com.sun.jdo.spi.persistence.support.sqlstore.state.LifeCycleState | getLifeCycleState(int state)Returns the LifeCycleState for the state constant.
if (logger.isLoggable(Logger.FINER)) {
logger.finer("sqlstore.state.lifecyclestate.initial",stateTypes[state]); // NOI18N
}
return stateTypes[state];
|
public int | getUpdateAction()
return updateAction;
|
protected static void | initLifeCycleState()Initialises the objects. This class implements the "state pattern".
// ******************************************************************
// Initialisation stuff
// ******************************************************************
initLifeCycleState();
stateTypes = new LifeCycleState[TOTAL];
stateTypes[HOLLOW] = new Hollow();
stateTypes[P_NON_TX] = new PersistentNonTransactional();
stateTypes[P_CLEAN] = new PersistentClean();
stateTypes[P_DIRTY] = new PersistentDirty();
stateTypes[P_NEW] = new PersistentNew();
stateTypes[P_NEW_FLUSHED] = new PersistentNewFlushed();
stateTypes[P_NEW_DELETED] = new PersistentNewDeleted();
stateTypes[P_NEW_FLUSHED_DELETED] = new PersistentNewFlushedDeleted();
stateTypes[P_DELETED] = new PersistentDeleted();
stateTypes[P_DELETED_FLUSHED] = new PersistentDeletedFlushed();
stateTypes[AP_NEW] = new AutoPersistentNew();
stateTypes[AP_NEW_PENDING] = new AutoPersistentNewPending();
stateTypes[AP_NEW_FLUSHED] = new AutoPersistentNewFlushed();
stateTypes[AP_NEW_FLUSHED_PENDING] = new AutoPersistentNewFlushedPending();
stateTypes[AP_NEW_FLUSHED_DELETED] = new AutoPersistentNewFlushedDeleted();
stateTypes[AP_NEW_DELETED] = new AutoPersistentNewDeleted();
stateTypes[TRANSIENT] = null;
|
public boolean | isAutoPersistent()Return whether the object is auto-persistent.
return isAutoPersistent;
|
public boolean | isBeforeImageUpdatable()
return isBeforeImageUpdatable;
|
public boolean | isDeleted()Return whether the object is deleted.
return isDeleted;
|
public boolean | isDirty()Return whether the object is dirty, i.e. has been changed
(created, updated, deleted) in this Tx.
return isDirty;
|
public boolean | isNavigable()Return whether the object can dynamically navigate to fields that are
not present.
return isNavigable;
|
public boolean | isNew()Return whether the object was newly created.
return isNew;
|
public boolean | isPersistent()/
/**
Return whether the object is persistent.
return isPersistent;
|
public boolean | isPersistentInDataStore()Return whether the object is persistent in data store.
return isPersistentInDataStore;
|
public boolean | isRefreshable()Return whether the object can be refreshed from the database.
return isRefreshable;
|
public boolean | isTransactional()Return whether the object is transactional.
return isTransactional;
|
public boolean | needMerge()
return needMerge;
|
public boolean | needsRegister()Return whether the object is registered with the persistence manager.
return needsRegister;
|
public boolean | needsReload(boolean optimistic, boolean nontransactionalRead, boolean transactionActive)
return needsReload;
|
public boolean | needsRestoreOnRollback(boolean retainValues)
//
// The default behavior is if retainValues is true, we always
// restore the state. Otherwise, the behavior is determined
// by needsRetoreOnRollback.
//
if (retainValues) {
return true;
}
return needsRestoreOnRollback;
|
public int | stateType()Returns the type of the life cycle state
return stateType;
|
public java.lang.String | toString()
switch (stateType) {
case HOLLOW:
return "HOLLOW"; // NOI18N
case P_NON_TX:
return "P_NON_TX"; // NOI18N
case P_CLEAN:
return "P_CLEAN"; // NOI18N
case P_DIRTY:
return "P_DIRTY"; // NOI18N
case P_NEW:
return "P_NEW"; // NOI18N
case P_NEW_FLUSHED:
return "P_NEW_FLUSHED"; // NOI18N
case P_NEW_FLUSHED_DELETED:
return "P_NEW_FLUSHED_DELETED"; // NOI18N
case P_NEW_DELETED:
return "P_NEW_DELETED"; // NOI18N
case P_DELETED:
return "P_DELETED"; // NOI18N
case P_DELETED_FLUSHED:
return "P_DELETED_FLUSHED"; // NOI18N
case AP_NEW:
return "AP_NEW"; // NOI18N
case AP_NEW_PENDING:
return "AP_NEW_PENDING"; // NOI18N
case AP_NEW_FLUSHED:
return "AP_NEW_FLUSHED"; // NOI18N
case AP_NEW_FLUSHED_PENDING:
return "AP_NEW_FLUSHED_PENDING"; // NOI18N
case AP_NEW_FLUSHED_DELETED:
return "AP_NEW_FLUSHED_DELETED"; // NOI18N
case AP_NEW_DELETED:
return "AP_NEW_DELETED"; //NOI18N
}
return null;
|
public com.sun.jdo.spi.persistence.support.sqlstore.state.LifeCycleState | transitionCommit(boolean retainValues)
return this;
|
public com.sun.jdo.spi.persistence.support.sqlstore.state.LifeCycleState | transitionDeletePersistent()
return this;
|
public com.sun.jdo.spi.persistence.support.sqlstore.state.LifeCycleState | transitionFlushed()
return this;
|
public com.sun.jdo.spi.persistence.support.sqlstore.state.LifeCycleState | transitionMakePending()
return this;
|
public com.sun.jdo.spi.persistence.support.sqlstore.state.LifeCycleState | transitionMakePersistent()
return this;
|
public com.sun.jdo.spi.persistence.support.sqlstore.state.LifeCycleState | transitionReadField(boolean optimisitic, boolean nontransactionalRead, boolean transactionActive)
if (!nontransactionalRead) {
assertTransaction(transactionActive);
}
return this;
|
public com.sun.jdo.spi.persistence.support.sqlstore.state.LifeCycleState | transitionRefreshPersistent()
return this;
|
public com.sun.jdo.spi.persistence.support.sqlstore.state.LifeCycleState | transitionReload(boolean transactionActive)
return this;
|
public com.sun.jdo.spi.persistence.support.sqlstore.state.LifeCycleState | transitionRollback(boolean retainValues)
return this;
|
public com.sun.jdo.spi.persistence.support.sqlstore.state.LifeCycleState | transitionWriteField(boolean transactionActive)
assertTransaction(transactionActive);
return this;
|