Package org.datanucleus.state
Class ReferentialStateManagerImpl
- java.lang.Object
-
- org.datanucleus.state.StateManagerImpl
-
- org.datanucleus.state.ReferentialStateManagerImpl
-
- All Implemented Interfaces:
StateManager
,ObjectProvider<Persistable>
public class ReferentialStateManagerImpl extends StateManagerImpl
Implementation of a StateManager for use where insertion ordering is important (such as RDBMS). Adds on simple handling to be run after an object is inserted.
-
-
Field Summary
-
Fields inherited from class org.datanucleus.state.StateManagerImpl
activity, cmd, currFM, dirty, dirtyFields, FLAG_ATTACHING, FLAG_BECOMING_DELETED, FLAG_CHANGING_STATE, FLAG_DETACHING, FLAG_DISCONNECTING, FLAG_FLUSHED_NEW, FLAG_FLUSHING, FLAG_LOADINGFPFIELDS, FLAG_MAKING_TRANSIENT, FLAG_NEED_INHERITANCE_VALIDATION, FLAG_POSTINSERT_UPDATE, FLAG_POSTLOAD_PENDING, FLAG_RESETTING_DETACHED_STATE, FLAG_RESTORE_VALUES, FLAG_RETRIEVING_DETACHED_STATE, FLAG_STORING_PC, FLAG_UPDATING_EMBEDDING_FIELDS_WITH_OWNER, FLAG_VALIDATING, flags, HOLLOWFIELDMANAGER, loadedFields, lock, myEC, myFP, myID, myInternalID, myLC, myPC, myVersion, objectType, persistenceFlags, savedImage, savedLoadedFields, savedPersistenceFlags, transactionalVersion
-
Fields inherited from interface org.datanucleus.state.ObjectProvider
EMBEDDED_COLLECTION_ELEMENT_PC, EMBEDDED_MAP_KEY_PC, EMBEDDED_MAP_VALUE_PC, EMBEDDED_PC, ORIGINAL_FIELD_VALUE_KEY_PREFIX, PC
-
-
Constructor Summary
Constructors Constructor Description ReferentialStateManagerImpl(ExecutionContext ec, AbstractClassMetaData cmd)
Constructor for object of specified type managed by the provided ExecutionContext.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changeActivityState(ActivityState activityState)
Change the activity state to a particular state.void
connect(ExecutionContext ec, AbstractClassMetaData cmd)
Method to (re)connect this provider to the specified ExecutionContext and object type.void
disconnect()
Disconnect from the ExecutionContext and persistable object.void
updateFieldAfterInsert(Object pc, int fieldNumber)
Marks the given field as being required to be updated when the specified object has been inserted.-
Methods inherited from class org.datanucleus.state.StateManagerImpl
areFieldsLoaded, attach, attach, attachCopy, becomingDeleted, checkInheritance, clearDirtyFlags, clearDirtyFlags, clearFields, clearFieldsByNumbers, clearLoadedFlags, clearNonPrimaryKeyFields, clearSavedFields, containsAssociatedValue, deletePersistent, detach, detachCopy, disconnectClone, dump, enlistInTransaction, evict, evictFromTransaction, flush, getAllFieldsLoaded, getAssociatedValue, getCallbackHandler, getClassMetaData, getDirtyFieldNames, getDirtyFieldNumbers, getDirtyFields, getExecutionContext, getExecutionContextReference, getExternalObjectId, getExternalObjectId, getFieldNumbersOfLoadedOrDirtyFields, getInternalObjectId, getLifecycleState, getLoadedFieldNames, getLoadedFieldNumbers, getLoadedFields, getObject, getObjectAsPrintable, getObjectId, getReferencedPC, getStoreManager, getTransactionalObjectId, getTransactionalVersion, getTransactionalVersion, getVersion, getVersion, initialiseForCachedPC, initialiseForDetached, initialiseForEmbedded, initialiseForHollow, initialiseForHollowAppId, initialiseForHollowPreConstructed, initialiseForPersistentClean, initialiseForPersistentNew, initialiseForPNewToBeDeleted, initialiseForTransactionalTransient, internalDeletePersistent, isAttaching, isChangingState, isDeleted, isDeleted, isDeleting, isDetaching, isDirty, isEmbedded, isFieldLoaded, isFlushedNew, isFlushedToDatastore, isFlushing, isInserting, isLoaded, isLoaded, isNew, isPersistent, isPostLoadPending, isRestoreValues, isStoringPC, isTransactional, isVersionLoaded, isWaitingToBeFlushedToDatastore, loadField, loadFieldFromDatastore, loadFieldsFromDatastore, loadFieldsFromLevel2Cache, loadFieldsInFetchPlan, loadFieldValues, loadSpecifiedFields, loadUnloadedFields, loadUnloadedFieldsInFetchPlan, loadUnloadedFieldsInFetchPlanAndVersion, loadUnloadedFieldsOfClassInFetchPlan, loadUnloadedRelationFields, locate, makeDirty, makeDirty, makeNontransactional, makePersistent, makePersistentTransactionalTransient, makeTransactional, makeTransient, markAsFlushed, markFieldsAsLoaded, markForInheritanceValidation, markPKFieldsAsLoaded, peekField, postCommit, postStateChange, postWriteField, preBegin, preRollback, preSerialize, preStateChange, preWriteField, providedBooleanField, providedByteField, providedCharField, providedDoubleField, providedFloatField, providedIntField, providedLongField, providedObjectField, providedShortField, providedStringField, provideField, provideField, provideFields, refresh, refreshFieldsInFetchPlan, refreshLoadedFields, registerTransactional, removeAssociatedValue, replaceAllLoadedSCOFieldsWithValues, replaceAllLoadedSCOFieldsWithWrappers, replaceField, replaceField, replaceField, replaceFieldMakeDirty, replaceFields, replaceFields, replaceFieldValue, replaceManagedPC, replaceNonLoadedFields, replaceStateManager, replacingBooleanField, replacingByteField, replacingCharField, replacingDetachedState, replacingDoubleField, replacingFlags, replacingFloatField, replacingIntField, replacingLongField, replacingObjectField, replacingShortField, replacingStateManager, replacingStringField, resetDetachState, restoreFields, retrieve, retrieveDetachState, saveFields, setAssociatedValue, setBooleanField, setByteField, setCharField, setDoubleField, setFloatField, setFlushedNew, setFlushing, setIntField, setLongField, setObjectField, setPcObjectType, setPostStoreNewObjectId, setShortField, setStoringPC, setStringField, setTransactionalVersion, setVersion, toString, transitionReadField, transitionWriteField, unloadField, unloadNonFetchPlanFields, unsetStoringPC, updateField, updateLevel2CacheForFields, updateOwnerFieldInEmbeddedField, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.datanucleus.enhancement.StateManager
getBooleanField, getByteField, getCharField, getDoubleField, getFloatField, getIntField, getLongField, getObjectField, getShortField, getStringField
-
-
-
-
Constructor Detail
-
ReferentialStateManagerImpl
public ReferentialStateManagerImpl(ExecutionContext ec, AbstractClassMetaData cmd)
Constructor for object of specified type managed by the provided ExecutionContext.- Parameters:
ec
- ExecutionContextcmd
- the metadata for the class.
-
-
Method Detail
-
connect
public void connect(ExecutionContext ec, AbstractClassMetaData cmd)
Description copied from interface:ObjectProvider
Method to (re)connect this provider to the specified ExecutionContext and object type.- Specified by:
connect
in interfaceObjectProvider<Persistable>
- Overrides:
connect
in classStateManagerImpl
- Parameters:
ec
- ExecutionContext to connect tocmd
- Metadata for this class
-
disconnect
public void disconnect()
Description copied from class:StateManagerImpl
Disconnect from the ExecutionContext and persistable object.- Specified by:
disconnect
in interfaceObjectProvider<Persistable>
- Overrides:
disconnect
in classStateManagerImpl
-
changeActivityState
public void changeActivityState(ActivityState activityState)
Change the activity state to a particular state.- Specified by:
changeActivityState
in interfaceObjectProvider<Persistable>
- Overrides:
changeActivityState
in classStateManagerImpl
- Parameters:
activityState
- the new state
-
updateFieldAfterInsert
public void updateFieldAfterInsert(Object pc, int fieldNumber)
Marks the given field as being required to be updated when the specified object has been inserted.- Specified by:
updateFieldAfterInsert
in interfaceObjectProvider<Persistable>
- Overrides:
updateFieldAfterInsert
in classStateManagerImpl
- Parameters:
pc
- The Persistable objectfieldNumber
- Number of the field.
-
-