public abstract class AbstractStateManager<T> extends Object implements ObjectProvider<T>
Modifier and Type | Field and Description |
---|---|
protected ActivityState |
activity
state for transitions of activities.
|
protected AbstractClassMetaData |
cmd
the metadata for the class.
|
protected FieldManager |
currFM
Current FieldManager.
|
protected boolean |
dirty
Indicator for whether the persistable instance is dirty.
|
protected boolean[] |
dirtyFields
indicators for which fields are currently dirty in the persistable instance.
|
protected static int |
FLAG_ATTACHING
Flag for
flags whether we are in the process of attaching the object. |
protected static int |
FLAG_BECOMING_DELETED |
protected static int |
FLAG_CHANGING_STATE |
protected static int |
FLAG_DETACHING
Flag for
flags whether we are in the process of detaching the object. |
protected static int |
FLAG_DISCONNECTING
Flag for
flags whether we are in the process of disconnecting the object. |
protected static int |
FLAG_FLUSHED_NEW
if the persistable object is new and was flushed to the datastore.
|
protected static int |
FLAG_FLUSHING
Flag for
flags whether we are in the process of flushing changes to the object. |
protected static int |
FLAG_LOADINGFPFIELDS |
protected static int |
FLAG_MAKING_TRANSIENT
Flag for
flags whether we are in the process of making transient the object. |
protected static int |
FLAG_NEED_INHERITANCE_VALIDATION
Whether the managed object needs the inheritance level validating before loading fields.
|
protected static int |
FLAG_POSTINSERT_UPDATE |
protected static int |
FLAG_POSTLOAD_PENDING |
protected static int |
FLAG_RESETTING_DETACHED_STATE
Flag for
flags whether we are resetting the detached state. |
protected static int |
FLAG_RETRIEVING_DETACHED_STATE
Flag for
flags whether we are retrieving detached state from the detached object. |
protected static int |
FLAG_STORING_PC
Flag to signify that we are currently storing the persistable object, so we don't detach it on serialisation.
|
protected static int |
FLAG_UPDATING_EMBEDDING_FIELDS_WITH_OWNER
Flag whether this SM is updating the ownership of its embedded/serialised field(s).
|
protected int |
flags
Bit-packed flags for operational settings (packed into "int" for memory benefit).
|
protected static SingleTypeFieldManager |
HOLLOWFIELDMANAGER |
protected boolean[] |
loadedFields
indicators for which fields are currently loaded in the persistable instance.
|
protected Lock |
lock
Lock object to synchronise execution when reading/writing fields.
|
protected short |
lockMode
The current lock mode for this object.
|
protected ExecutionContext |
myEC
The ExecutionContext for this StateManager
|
protected FetchPlanForClass |
myFP
Fetch plan for the class of the managed object.
|
protected Object |
myID
The object identity in the datastore
|
protected Object |
myInternalID
The object identity in the JVM.
|
protected LifeCycleState |
myLC
The actual LifeCycleState for the persistable instance
|
protected T |
myPC
The persistable instance managed by this ObjectProvider.
|
protected Object |
myVersion
version field for optimistic transactions
|
protected short |
objectType
The type of the managed object (0 = PC, 1 = embedded PC, 2 = embedded element, 3 = embedded key, 4 = embedded value.
|
static Map<String,ObjectValueGenerator> |
objectValGenerators
Cache of object-value-generators, keyed by their symbolic name.
|
protected byte |
persistenceFlags
Flags for state stored with the object.
|
protected boolean |
restoreValues
Whether to restore values at StateManager.
|
protected byte |
savedFlags
Flags of the persistable instance when the instance is enlisted in the transaction.
|
protected boolean[] |
savedLoadedFields
Loaded fields of the persistable instance when the instance is enlisted in the transaction.
|
protected Object |
transactionalVersion
version field for optimistic transactions, after a insert/update but not yet committed.
|
EMBEDDED_COLLECTION_ELEMENT_PC, EMBEDDED_MAP_KEY_PC, EMBEDDED_MAP_VALUE_PC, EMBEDDED_PC, ORIGINAL_FIELD_VALUE_KEY_PREFIX, PC
Constructor and Description |
---|
AbstractStateManager(ExecutionContext ec,
AbstractClassMetaData cmd)
Constructor for object of specified type managed by the provided ExecutionContext.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
areFieldsLoaded(int[] fieldNumbers)
Accessor for whether all of the specified field numbers are loaded.
|
boolean |
becomingDeleted()
Whether this object is moving to a deleted state.
|
protected void |
clearDirtyFlags()
Method to clear all dirty flags on the object.
|
protected void |
clearDirtyFlags(int[] fieldNumbers)
Method to clear all dirty flags on the object.
|
protected void |
clearFieldsByNumbers(int[] fieldNumbers) |
void |
connect(ExecutionContext ec,
AbstractClassMetaData cmd)
Method to (re)connect the provider to the specified ExecutionContext and object type.
|
boolean |
containsAssociatedValue(Object key) |
void |
evict()
Method to change the object state to evicted.
|
boolean |
getAllFieldsLoaded()
Returns whether all fields are loaded.
|
Object |
getAssociatedValue(Object key)
Accessor for an associated value stored with this object.
|
protected CallbackHandler |
getCallbackHandler()
returns the handler for callback events.
|
AbstractClassMetaData |
getClassMetaData()
Accessor for the ClassMetaData for this object.
|
String[] |
getDirtyFieldNames()
Convenience accessor for the names of the fields that are dirty.
|
int[] |
getDirtyFieldNumbers()
Accessor for the field numbers of all dirty fields.
|
boolean[] |
getDirtyFields()
Creates a copy of the
dirtyFields bitmap. |
ExecutionContext |
getExecutionContext()
Accessor for the ExecutionContext for this object.
|
protected int[] |
getFieldNumbersOfLoadedOrDirtyFields(boolean[] loadedFields,
boolean[] dirtyFields)
Convenience accessor to return the field numbers for the input loaded and dirty field arrays.
|
Object |
getInternalObjectId()
Accessor for the internal object id of the object we are managing.
|
LifeCycleState |
getLifecycleState()
Accessor for the LifeCycleState
|
String[] |
getLoadedFieldNames()
Convenience accessor for the names of the fields that are loaded.
|
int[] |
getLoadedFieldNumbers()
Accessor for the field numbers of all loaded fields in this managed instance.
|
boolean[] |
getLoadedFields()
Accessor for the fields
|
short |
getLockMode()
Accessor for the current lock mode.
|
abstract T |
getObject()
Accessor for the persistable object being managed.
|
String |
getObjectAsPrintable()
Returns a printable form of the managed object.
|
protected static ObjectValueGenerator |
getObjectValueGenerator(ExecutionContext ec,
String genName)
Method to find an object value generator based on its name.
|
T |
getReferencedPC()
Accessor for the referenced PC object when we are attaching or detaching.
|
StoreManager |
getStoreManager() |
Object |
getTransactionalVersion(Object pc)
Return the object representing the transactional version of the calling instance.
|
protected void |
internalDeletePersistent()
Method to delete the object from the datastore.
|
boolean |
isAttaching() |
protected boolean |
isChangingState() |
boolean |
isDeleting()
Tests whether this object is in the process of being deleted.
|
boolean |
isDetaching() |
protected boolean |
isDisconnecting() |
boolean |
isEmbedded()
Convenience accessor for whether this StateManager manages an embedded/serialised object.
|
boolean |
isFieldLoaded(int fieldNumber)
Accessor for whether a field is currently loaded.
|
boolean |
isFlushedNew()
Whether this record has been flushed to the datastore in this transaction (i.e called persist() and is in
the datastore now).
|
boolean |
isFlushedToDatastore()
Accessor for whether all changes have been written to the datastore.
|
protected boolean |
isFlushing() |
boolean |
isInserting()
Tests whether this object is being inserted.
|
protected boolean |
isMakingTransient() |
protected boolean |
isPostLoadPending() |
protected boolean |
isResettingDetachedState() |
boolean |
isRestoreValues()
Accessor for whether we are in the process of restoring the values.
|
protected boolean |
isRetrievingDetachedState() |
protected boolean |
isStoringPC() |
boolean |
isWaitingToBeFlushedToDatastore()
Accessor for whether the instance is newly persistent yet hasnt yet been flushed to the datastore.
|
void |
loadFieldFromDatastore(int fieldNumber)
Convenience method to load a field from the datastore.
|
protected void |
loadFieldsFromDatastore(int[] fieldNumbers)
Convenience method to load fields from the datastore.
|
protected int[] |
loadFieldsFromLevel2Cache(int[] fieldNumbers)
Convenience method to retrieve field values from an L2 cached object if they are loaded in that object.
|
void |
loadFieldsInFetchPlan(FetchPlanState state)
Method to load all unloaded fields in the FetchPlan.
|
void |
locate()
Locate the object in the datastore.
|
void |
lock(short lockMode)
Method to lock the object owned by this ObjectProvider.
|
void |
makeNontransactional()
Method to change the object state to nontransactional.
|
void |
makePersistentTransactionalTransient()
Makes Transactional Transient instances persistent.
|
void |
markAsFlushed()
Method to notify the object provider that the object has now been flushed to the datastore.
|
void |
markForInheritanceValidation()
Mark the state manager as needing to validate the inheritance of the managed object existence
before loading fields.
|
protected void |
markPKFieldsAsLoaded()
Convenience method to mark PK fields as loaded (if using app id).
|
void |
postCommit(Transaction tx)
This method is invoked just after a commit is performed in a Transaction
involving the persistable object managed by this StateManager
|
protected abstract void |
postStateChange()
Method called after a change in state.
|
void |
preBegin(Transaction tx)
Method invoked just before a transaction starts for the ExecutionContext managing us.
|
void |
preRollback(Transaction tx)
This method is invoked just before a rollback is performed in a Transaction
involving the persistable object managed by this StateManager.
|
protected void |
preStateChange()
Method called before a change in state.
|
void |
providedBooleanField(T pc,
int fieldNumber,
boolean currentValue)
This method is called from the associated persistable when its dnProvideFields() method is invoked.
|
void |
providedByteField(T pc,
int fieldNumber,
byte currentValue)
This method is called from the associated persistable when its dnProvideFields() method is invoked.
|
void |
providedCharField(T pc,
int fieldNumber,
char currentValue)
This method is called from the associated persistable when its dnProvideFields() method is invoked.
|
void |
providedDoubleField(T pc,
int fieldNumber,
double currentValue)
This method is called from the associated persistable when its dnProvideFields() method is invoked.
|
void |
providedFloatField(T pc,
int fieldNumber,
float currentValue)
This method is called from the associated persistable when its dnProvideFields() method is invoked.
|
void |
providedIntField(T pc,
int fieldNumber,
int currentValue)
This method is called from the associated persistable when its dnProvideFields() method is invoked.
|
void |
providedLongField(T pc,
int fieldNumber,
long currentValue)
This method is called from the associated persistable when its dnProvideFields() method is invoked.
|
void |
providedObjectField(T pc,
int fieldNumber,
Object currentValue)
This method is called from the associated persistable when its dnProvideFields() method is invoked.
|
void |
providedShortField(T pc,
int fieldNumber,
short currentValue)
This method is called from the associated persistable when its dnProvideFields() method is invoked.
|
void |
providedStringField(T pc,
int fieldNumber,
String currentValue)
This method is called from the associated persistable when its dnProvideFields() method is invoked.
|
abstract void |
provideFields(int[] fieldNumbers,
FieldManager fm)
Called from the StoreManager after StoreManager.update() is called to obtain updated values
from the persistable associated with this StateManager.
|
void |
refresh()
Method to refresh the object.
|
void |
registerTransactional()
Registers the pc class in the cache
|
void |
removeAssociatedValue(Object key)
Method to remove the associated value with the specified key (if it exists).
|
abstract void |
replaceFields(int[] fieldNumbers,
FieldManager fm)
Called from the StoreManager to refresh data in the persistable object associated with this StateManager.
|
boolean |
replacingBooleanField(T pc,
int fieldNumber)
This method is invoked by the persistable object's dnReplaceField() method to refresh the value of a boolean field.
|
byte |
replacingByteField(T obj,
int fieldNumber)
This method is invoked by the persistable object's dnReplaceField() method to refresh the value of a byte field.
|
char |
replacingCharField(T obj,
int fieldNumber)
This method is invoked by the persistable object's dnReplaceField() method to refresh the value of a char field.
|
double |
replacingDoubleField(T obj,
int fieldNumber)
This method is invoked by the persistable object's dnReplaceField() method to refresh the value of a double field.
|
float |
replacingFloatField(T obj,
int fieldNumber)
This method is invoked by the persistable object's dnReplaceField() method to refresh the value of a float field.
|
int |
replacingIntField(T obj,
int fieldNumber)
This method is invoked by the persistable object's dnReplaceField() method to refresh the value of a int field.
|
long |
replacingLongField(T obj,
int fieldNumber)
This method is invoked by the persistable object's dnReplaceField() method to refresh the value of a long field.
|
Object |
replacingObjectField(T obj,
int fieldNumber)
This method is invoked by the persistable object's dnReplaceField() method to refresh the value of an Object field.
|
short |
replacingShortField(T obj,
int fieldNumber)
This method is invoked by the persistable object's dnReplaceField() method to refresh the value of a short field.
|
String |
replacingStringField(T obj,
int fieldNumber)
This method is invoked by the persistable object's dnReplaceField() method to refresh the value of a String field.
|
void |
retrieve(boolean fgOnly)
Method to retrieve the object.
|
void |
setAssociatedValue(Object key,
Object value)
Method to set an associated value stored with this object.
|
void |
setFlushedNew(boolean flag) |
void |
setFlushing(boolean flushing) |
void |
setPcObjectType(short objType)
Method to set this StateManager as managing an embedded/serialised object.
|
void |
setStoringPC()
Method to set the storing PC flag.
|
void |
setTransactionalVersion(Object version)
Sets the value for the version column in a transaction not yet committed
|
void |
setVersion(Object version)
Sets the value for the version column in the datastore
|
String |
toString() |
protected void |
transitionReadField(boolean isLoaded)
Method to change the object state to read-field.
|
protected void |
transitionWriteField()
Method to change the object state to write-field.
|
void |
unloadField(String fieldName)
Convenience method to unload a field/property.
|
void |
unloadNonFetchPlanFields()
Method that will unload all fields that are not in the FetchPlan.
|
void |
unlock()
Method to unlock the object owned by this ObjectProvider (if locked).
|
void |
unsetStoringPC()
Method to unset the storing PC flag.
|
protected void |
updateLevel2CacheForFields(int[] fieldNumbers)
Convenience method to update a Level2 cached version of this object if cacheable
and has not been modified during this transaction.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
attach, attach, attachCopy, changeActivityState, checkInheritance, clearFields, clearLoadedFlags, clearNonPrimaryKeyFields, clearSavedFields, copyFieldsFromObject, deletePersistent, detach, detachCopy, disconnect, enlistInTransaction, evictFromTransaction, flush, getExternalObjectId, getTransactionalVersion, getVersion, initialiseForCachedPC, initialiseForDetached, initialiseForEmbedded, initialiseForHollow, initialiseForHollowAppId, initialiseForHollowPreConstructed, initialiseForPersistentClean, initialiseForPersistentNew, initialiseForPNewToBeDeleted, initialiseForTransactionalTransient, isDeleted, isLoaded, loadField, loadFieldValues, loadUnloadedFields, loadUnloadedFieldsInFetchPlan, loadUnloadedFieldsOfClassInFetchPlan, loadUnloadedRelationFields, makeDirty, makePersistent, makeTransactional, makeTransient, provideField, refreshFieldsInFetchPlan, refreshLoadedFields, replaceAllLoadedSCOFieldsWithValues, replaceAllLoadedSCOFieldsWithWrappers, replaceField, replaceFieldMakeDirty, replaceFields, replaceFieldValue, replaceManagedPC, replaceNonLoadedFields, resetDetachState, restoreFields, retrieveDetachState, saveFields, setPostStoreNewObjectId, updateFieldAfterInsert, updateOwnerFieldInEmbeddedField, validate
protected static final SingleTypeFieldManager HOLLOWFIELDMANAGER
protected static final int FLAG_STORING_PC
protected static final int FLAG_NEED_INHERITANCE_VALIDATION
protected static final int FLAG_POSTINSERT_UPDATE
protected static final int FLAG_LOADINGFPFIELDS
protected static final int FLAG_POSTLOAD_PENDING
protected static final int FLAG_CHANGING_STATE
protected static final int FLAG_FLUSHED_NEW
protected static final int FLAG_BECOMING_DELETED
protected static final int FLAG_UPDATING_EMBEDDING_FIELDS_WITH_OWNER
protected static final int FLAG_RETRIEVING_DETACHED_STATE
flags
whether we are retrieving detached state from the detached object.protected static final int FLAG_RESETTING_DETACHED_STATE
flags
whether we are resetting the detached state.protected static final int FLAG_ATTACHING
flags
whether we are in the process of attaching the object.protected static final int FLAG_DETACHING
flags
whether we are in the process of detaching the object.protected static final int FLAG_MAKING_TRANSIENT
flags
whether we are in the process of making transient the object.protected static final int FLAG_FLUSHING
flags
whether we are in the process of flushing changes to the object.protected static final int FLAG_DISCONNECTING
flags
whether we are in the process of disconnecting the object.protected T myPC
protected int flags
protected boolean restoreValues
protected ExecutionContext myEC
protected AbstractClassMetaData cmd
protected Object myInternalID
protected Object myID
protected LifeCycleState myLC
protected Object myVersion
protected Object transactionalVersion
protected byte persistenceFlags
protected FetchPlanForClass myFP
protected boolean dirty
protected boolean[] dirtyFields
protected boolean[] loadedFields
protected Lock lock
protected short lockMode
protected byte savedFlags
protected boolean[] savedLoadedFields
protected ActivityState activity
protected FieldManager currFM
protected short objectType
public static final Map<String,ObjectValueGenerator> objectValGenerators
public AbstractStateManager(ExecutionContext ec, AbstractClassMetaData cmd)
ec
- ExecutionContextcmd
- the metadata for the class.public void connect(ExecutionContext ec, AbstractClassMetaData cmd)
connect
in interface ObjectProvider<T>
ec
- ExecutionContext to connect tocmd
- Metadata for this classpublic AbstractClassMetaData getClassMetaData()
getClassMetaData
in interface ObjectProvider<T>
public ExecutionContext getExecutionContext()
getExecutionContext
in interface ObjectProvider<T>
public StoreManager getStoreManager()
getStoreManager
in interface ObjectProvider<T>
public LifeCycleState getLifecycleState()
getLifecycleState
in interface ObjectProvider<T>
protected CallbackHandler getCallbackHandler()
public abstract T getObject()
getObject
in interface ObjectProvider<T>
public String getObjectAsPrintable()
ObjectProvider
getObjectAsPrintable
in interface ObjectProvider<T>
public Object getInternalObjectId()
getInternalObjectId
in interface ObjectProvider<T>
public boolean isInserting()
isInserting
in interface ObjectProvider<T>
public boolean isWaitingToBeFlushedToDatastore()
isWaitingToBeFlushedToDatastore
in interface ObjectProvider<T>
public boolean isRestoreValues()
isRestoreValues
in interface ObjectProvider<T>
public void setStoringPC()
ObjectProvider
setStoringPC
in interface ObjectProvider<T>
public void unsetStoringPC()
ObjectProvider
unsetStoringPC
in interface ObjectProvider<T>
protected boolean isStoringPC()
protected boolean isPostLoadPending()
protected boolean isChangingState()
protected boolean isResettingDetachedState()
protected boolean isRetrievingDetachedState()
protected boolean isDisconnecting()
protected boolean isMakingTransient()
public boolean isDeleting()
ObjectProvider
isDeleting
in interface ObjectProvider<T>
public boolean becomingDeleted()
ObjectProvider
becomingDeleted
in interface ObjectProvider<T>
public void markForInheritanceValidation()
ObjectProvider
markForInheritanceValidation
in interface ObjectProvider<T>
public boolean isDetaching()
public boolean isAttaching()
public void setTransactionalVersion(Object version)
setTransactionalVersion
in interface ObjectProvider<T>
version
- The versionpublic Object getTransactionalVersion(Object pc)
pc
- the calling persistable instancepublic void setVersion(Object version)
setVersion
in interface ObjectProvider<T>
version
- The versionpublic void setFlushedNew(boolean flag)
setFlushedNew
in interface ObjectProvider<T>
public boolean isFlushedNew()
ObjectProvider
isFlushedNew
in interface ObjectProvider<T>
public boolean isFlushedToDatastore()
ObjectProvider
isFlushedToDatastore
in interface ObjectProvider<T>
public void setFlushing(boolean flushing)
setFlushing
in interface ObjectProvider<T>
protected boolean isFlushing()
public void markAsFlushed()
ObjectProvider
markAsFlushed
in interface ObjectProvider<T>
protected void preStateChange()
protected abstract void postStateChange()
public void refresh()
refresh
in interface ObjectProvider<T>
public void retrieve(boolean fgOnly)
retrieve
in interface ObjectProvider<T>
fgOnly
- Only load the current fetch group fieldspublic void makePersistentTransactionalTransient()
makePersistentTransactionalTransient
in interface ObjectProvider<T>
public void makeNontransactional()
makeNontransactional
in interface ObjectProvider<T>
protected void transitionReadField(boolean isLoaded)
isLoaded
- if the field was previously loadedprotected void transitionWriteField()
public void evict()
evict
in interface ObjectProvider<T>
public void preBegin(Transaction tx)
preBegin
in interface ObjectProvider<T>
tx
- The transactionpublic void postCommit(Transaction tx)
postCommit
in interface ObjectProvider<T>
tx
- The transactionpublic void preRollback(Transaction tx)
preRollback
in interface ObjectProvider<T>
tx
- The transactionprotected void internalDeletePersistent()
public void locate()
locate
in interface ObjectProvider<T>
NucleusObjectNotFoundException
- if the object doesnt exist.public T getReferencedPC()
getReferencedPC
in interface ObjectProvider<T>
public abstract void provideFields(int[] fieldNumbers, FieldManager fm)
provideFields
in interface ObjectProvider<T>
fieldNumbers
- An array of field numbers to be updated by the Storefm
- The updated values are stored in this object. This object is only valid
for the duration of this call.public abstract void replaceFields(int[] fieldNumbers, FieldManager fm)
replaceFields
in interface ObjectProvider<T>
fieldNumbers
- An array of field numbers to be refreshed by the Storefm
- The updated values are stored in this object. This object is only valid
for the duration of this call.protected boolean areFieldsLoaded(int[] fieldNumbers)
fieldNumbers
- The field numbers to checkpublic void unloadNonFetchPlanFields()
unloadNonFetchPlanFields
in interface ObjectProvider<T>
protected void markPKFieldsAsLoaded()
protected void updateLevel2CacheForFields(int[] fieldNumbers)
fieldNumbers
- Numbers of fields to update in L2 cached objectprotected int[] loadFieldsFromLevel2Cache(int[] fieldNumbers)
fieldNumbers
- Numbers of fields to load from the L2 cachepublic void loadFieldsInFetchPlan(FetchPlanState state)
loadFieldsInFetchPlan
in interface ObjectProvider<T>
state
- The FetchPlan statepublic void loadFieldFromDatastore(int fieldNumber)
loadFieldFromDatastore
in interface ObjectProvider<T>
fieldNumber
- The field number.protected void loadFieldsFromDatastore(int[] fieldNumbers)
fieldNumbers
- The field numbers.protected int[] getFieldNumbersOfLoadedOrDirtyFields(boolean[] loadedFields, boolean[] dirtyFields)
loadedFields
- Fields that were detached with the objectdirtyFields
- Fields that have been modified while detachedpublic boolean[] getDirtyFields()
dirtyFields
bitmap.getDirtyFields
in interface ObjectProvider<T>
dirtyFields
bitmap.public int[] getDirtyFieldNumbers()
getDirtyFieldNumbers
in interface ObjectProvider<T>
public boolean[] getLoadedFields()
getLoadedFields
in interface ObjectProvider<T>
public int[] getLoadedFieldNumbers()
getLoadedFieldNumbers
in interface ObjectProvider<T>
public boolean getAllFieldsLoaded()
getAllFieldsLoaded
in interface ObjectProvider<T>
public String[] getDirtyFieldNames()
getDirtyFieldNames
in interface ObjectProvider<T>
public String[] getLoadedFieldNames()
getLoadedFieldNames
in interface ObjectProvider<T>
public boolean isFieldLoaded(int fieldNumber)
isFieldLoaded
in interface ObjectProvider<T>
fieldNumber
- The (absolute) field numberprotected void clearFieldsByNumbers(int[] fieldNumbers)
protected void clearDirtyFlags()
protected void clearDirtyFlags(int[] fieldNumbers)
fieldNumbers
- the fields to clearpublic void unloadField(String fieldName)
unloadField
in interface ObjectProvider<T>
fieldName
- Name of the field/propertyNucleusUserException
- if the object managed by this StateManager is embeddedpublic boolean isEmbedded()
isEmbedded
in interface ObjectProvider<T>
public void providedBooleanField(T pc, int fieldNumber, boolean currentValue)
pc
- the calling persistable instancefieldNumber
- the field numbercurrentValue
- the current value of the fieldpublic void providedByteField(T pc, int fieldNumber, byte currentValue)
pc
- the calling persistable instancefieldNumber
- the field numbercurrentValue
- the current value of the fieldpublic void providedCharField(T pc, int fieldNumber, char currentValue)
pc
- the calling persistable instancefieldNumber
- the field numbercurrentValue
- the current value of the fieldpublic void providedDoubleField(T pc, int fieldNumber, double currentValue)
pc
- the calling persistable instancefieldNumber
- the field numbercurrentValue
- the current value of the fieldpublic void providedFloatField(T pc, int fieldNumber, float currentValue)
pc
- the calling persistable instancefieldNumber
- the field numbercurrentValue
- the current value of the fieldpublic void providedIntField(T pc, int fieldNumber, int currentValue)
pc
- the calling persistable instancefieldNumber
- the field numbercurrentValue
- the current value of the fieldpublic void providedLongField(T pc, int fieldNumber, long currentValue)
pc
- the calling persistable instancefieldNumber
- the field numbercurrentValue
- the current value of the fieldpublic void providedShortField(T pc, int fieldNumber, short currentValue)
pc
- the calling persistable instancefieldNumber
- the field numbercurrentValue
- the current value of the fieldpublic void providedStringField(T pc, int fieldNumber, String currentValue)
pc
- the calling persistable instancefieldNumber
- the field numbercurrentValue
- the current value of the fieldpublic void providedObjectField(T pc, int fieldNumber, Object currentValue)
pc
- the calling persistable instancefieldNumber
- the field numbercurrentValue
- the current value of the fieldpublic boolean replacingBooleanField(T pc, int fieldNumber)
pc
- the calling persistable instancefieldNumber
- the field numberpublic byte replacingByteField(T obj, int fieldNumber)
obj
- the calling persistable instancefieldNumber
- the field numberpublic char replacingCharField(T obj, int fieldNumber)
obj
- the calling persistable instancefieldNumber
- the field numberpublic double replacingDoubleField(T obj, int fieldNumber)
obj
- the calling persistable instancefieldNumber
- the field numberpublic float replacingFloatField(T obj, int fieldNumber)
obj
- the calling persistable instancefieldNumber
- the field numberpublic int replacingIntField(T obj, int fieldNumber)
obj
- the calling persistable instancefieldNumber
- the field numberpublic long replacingLongField(T obj, int fieldNumber)
obj
- the calling persistable instancefieldNumber
- the field numberpublic short replacingShortField(T obj, int fieldNumber)
obj
- the calling persistable instancefieldNumber
- the field numberpublic String replacingStringField(T obj, int fieldNumber)
obj
- the calling persistable instancefieldNumber
- the field numberpublic Object replacingObjectField(T obj, int fieldNumber)
obj
- the calling persistable instancefieldNumber
- the field numberpublic void setPcObjectType(short objType)
setPcObjectType
in interface ObjectProvider<T>
objType
- The type of object being managedpublic void lock(short lockMode)
ObjectProvider
lock
in interface ObjectProvider<T>
lockMode
- Lock mode to applypublic void unlock()
ObjectProvider
unlock
in interface ObjectProvider<T>
public short getLockMode()
ObjectProvider
getLockMode
in interface ObjectProvider<T>
public void registerTransactional()
registerTransactional
in interface ObjectProvider<T>
public void setAssociatedValue(Object key, Object value)
setAssociatedValue
in interface ObjectProvider<T>
key
- Key for the valuevalue
- The associated valuepublic Object getAssociatedValue(Object key)
getAssociatedValue
in interface ObjectProvider<T>
key
- Key for the valuepublic void removeAssociatedValue(Object key)
ObjectProvider
removeAssociatedValue
in interface ObjectProvider<T>
key
- The keypublic boolean containsAssociatedValue(Object key)
protected static ObjectValueGenerator getObjectValueGenerator(ExecutionContext ec, String genName)
ec
- ExecutionContextgenName
- The generator nameNucleusException
- if no generator of that name is foundCopyright © 2017. All rights reserved.