|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface StateManager
Extension to SUN's JDO StateManager class. This makes the assumption that a StateManager corresponds to ONE PersistenceCapable object. As a result of this assumption various methods are added to the basic JDO definition.
| Field Summary | |
|---|---|
static int |
EMBEDDED_COLLECTION_ELEMENT_PC
Embedded (or serialised) Collection Element PC |
static int |
EMBEDDED_MAP_KEY_PC
Embedded (or serialised) Map Key PC |
static int |
EMBEDDED_MAP_VALUE_PC
Embedded (or serialised) Map Value PC |
static int |
EMBEDDED_PC
Embedded (or serialised) PC |
static int |
PC
PC |
| Method Summary | |
|---|---|
void |
addEmbeddedOwner(StateManager ownerSM,
int ownerFieldNumber)
Method to register an owner StateManager with this embedded/serialised object. |
java.lang.Object |
attachCopy(javax.jdo.spi.PersistenceCapable detachedPC,
boolean embedded)
Method to attach to this the detached PersistenceCapable instance |
void |
changeActivityState(ActivityState activityState,
DatastoreClass table)
Update the acitvity state. |
void |
checkInheritance(FieldValues fv)
Look to the database to determine which class this object is. |
void |
clearFields()
Method to clear all fields of the object. |
void |
clearLoadedFlags()
Method to clear all loaded flags on the object. |
void |
clearNonPrimaryKeyFields()
Method to clear all fields that are not part of the primary key of the object. |
void |
clearSavedFields()
Method to clear all saved fields on the object. |
void |
deletePersistent()
Method to delete the object from persistence. |
void |
detach(FetchPlanState state)
Method to detach the PersistenceCapable object. |
java.lang.Object |
detachCopy(FetchPlanState state)
Method to make detached copy of this instance |
void |
disconnect()
Disconnect the StateManager from the PersistenceManager and PC object. |
void |
dump(java.io.PrintWriter out)
Diagnostic method to dump the current state to the provided PrintWriter. |
void |
enlistInTransaction()
|
void |
evict()
Method to change the object state to evicted. |
void |
evictFromTransaction()
|
void |
flush()
Method to flush all changes to the datastore. |
java.lang.Object |
getAttachedPC()
When an object is being attached it will temporarily have a StateManager connected, and during this time this method gives access to the attached variant of the object. |
AbstractClassMetaData |
getClassMetaData()
Accessor for the ClassMetaData for this object. |
java.lang.String[] |
getDirtyFieldNames()
Accessor for the names of all dirty fields. |
java.lang.Object |
getExternalObjectId(javax.jdo.spi.PersistenceCapable pc)
return a copy from the object Id |
int |
getHighestFieldNumber()
Accessor for the highest field number |
java.lang.Object |
getInternalObjectId()
Accessor for the id of the object managed by this StateManager. |
CachedPC |
getL2CacheableObject()
Accessor for an L2 cacheable form of this object. |
java.lang.String[] |
getLoadedFieldNames()
Accessor for the names of all loaded fields. |
MetaDataManager |
getMetaDataManager()
Accessor for the manager for MetaData. |
javax.jdo.spi.PersistenceCapable |
getObject()
Accessor for the object managed by this StateManager. |
PersistenceManager |
getPersistenceManager()
Returns the PersistenceManager that owns the StateManager instance |
StoreManager |
getStoreManager()
Accessor for the manager for the store. |
java.lang.Object |
getTransactionalVersion(javax.jdo.spi.PersistenceCapable pc)
Return the object representing the transactional version of the calling instance. |
java.lang.Object |
getValueForExternalField(JavaTypeMapping mapping)
Accessor for the value of an external field. |
boolean |
isEmbedded()
Convenience accessor for whether this StateManager manages an embedded/serialised object. |
boolean |
isInserted(int fieldNumber)
Returns whether the field of this object is inserted in the datastore. |
boolean |
isInserting()
Tests whether this object is being inserted. |
boolean |
isRestoreValues()
Accessor for the Restore Values flag |
void |
loadFieldsInFetchPlan(FetchPlanState state)
Method to load all unloaded fields in the FetchPlan. |
void |
loadFieldValues(FieldValues fv)
Convenience method to load the passed field values. |
void |
loadUnloadedFields()
Fetch from the database all fields that are not currently loaded regardless of whether they are in the current fetch group or not. |
void |
loadUnloadedFieldsInFetchPlan()
Fetchs from the database all fields that are not currently loaded and that are in the current fetch group. |
void |
loadUnloadedFieldsOfClassInFetchPlan(javax.jdo.FetchPlan fetchPlan)
Loads all unloaded fields of the managed class that are in the current FetchPlan. |
void |
makeDirty(int fieldNumber)
Method to mark the specified (absolute) field number as dirty. |
void |
makeNontransactional()
Method to make the managed object nontransactional. |
void |
makePersistent()
Method to make the managed object persistent. |
void |
makePersistentTransactionalTransient()
Method to make Transactional Transient instances persistent |
void |
makeTransactional()
Method to make the managed object transactional. |
void |
makeTransient(FetchPlanState state)
Method to make the managed object transient. |
java.lang.Object |
newSCOEmptyInstance(int fieldNumber)
Method to return an empty SCO wrapper for the specified field. |
java.lang.Object |
newSCOInstance(int fieldNumber,
java.lang.Object value,
boolean forUpdate)
Method to create a new SCO wrapper for a second class field. |
void |
nullifyFields()
Nullify fields with reference to PersistenceCapable or SCO instances |
void |
postCommit(javax.jdo.Transaction tx)
Convenience interceptor to allow operations to be performed after the commit is performed but before returning control to the application. |
void |
preRollback(javax.jdo.Transaction tx)
Convenience interceptor to allow operations to be performed before any rollback is performed. |
java.lang.Object |
provideField(int fieldNumber)
Method to return the current value of the specified field. |
void |
provideFields(int[] fieldNumbers,
FieldManager fm)
Method to obtain updated field values from the passed FieldManager. |
void |
refresh()
Method to refresh the values of the currently loaded fields in the managed object. |
void |
refreshFieldsInFetchPlan()
Refreshes from the database all fields in fetch plan. |
void |
refreshLoadedFields()
Refreshes from the database all fields currently loaded. |
void |
registerTransactional()
Registers the pc class in the cache |
void |
replaceField(int fieldNumber,
java.lang.Object value)
Method to change the value of the specified field. |
void |
replaceFields(int[] fieldNumbers,
FieldManager fm)
Method to update the data in the object with the values from the passed FieldManager |
void |
replaceFields(int[] fieldNumbers,
FieldManager fm,
boolean replaceDirtyFields)
Method to update the data in the object with the values from the passed FieldManager |
void |
replaceNonLoadedFields(int[] fieldNumbers,
FieldManager fm)
Method to update the data in the object with the values from the passed FieldManager. |
java.lang.Object |
replaceSCOField(int fieldNumber,
java.lang.Object value)
Wrap a field value with a SCO instance |
void |
resetDetachState()
Convenience method to reset the detached state in the current object. |
void |
restoreFields()
Method to restore all fields of the object. |
void |
retrieve(boolean fgOnly)
Method to retrieve the fields for this object. |
void |
retrieve(javax.jdo.FetchPlan fetchPlan)
Method to retrieve the object. |
void |
retrieveDetachState(StateManager sm)
Convenience method to retrieve the detach state from the passed State Manager's object |
void |
runReachability(java.util.Set reachables)
Method to run reachability from this StateManager. |
void |
saveFields()
Method to save all fields of the object. |
void |
setExternalFieldValueForMapping(JavaTypeMapping mapping,
java.lang.Object value)
Method to set the value for an external field stored against this object |
void |
setPcObjectType(int embeddedType)
Method to set this StateManager as managing an embedded/serialised object. |
void |
setPostStoreNewObjectId(java.lang.Object id)
If the id is obtained after inserting the object into the database, set new a new id for persistent classes (for example, increment). |
void |
setStoringPC()
Method to set the storing PC flag. |
void |
setTransactionalVersion(java.lang.Object optimisticTransactionalVersion)
Sets the value for the version column in a transaction not yet committed |
void |
setVersion(java.lang.Object version)
Sets the value for the version column in the datastore. |
void |
unloadField(java.lang.String fieldName)
Drop any loaded state for the given field, so upon next access it will get reloaded. |
void |
unsetStoringPC()
Method to unset the storing PC flag. |
void |
updateFieldAfterInsert(javax.jdo.spi.PersistenceCapable pc,
int fieldNumber)
Marks the given field dirty for issuing an update after the insert. |
void |
validate()
Validates whether the persistence capable instance exists in the datastore. |
| Methods inherited from interface javax.jdo.spi.StateManager |
|---|
getBooleanField, getByteField, getCharField, getDoubleField, getFloatField, getIntField, getLongField, getObjectField, getObjectId, getPersistenceManager, getShortField, getStringField, getTransactionalObjectId, getVersion, isDeleted, isDirty, isLoaded, isNew, isPersistent, isTransactional, makeDirty, preSerialize, providedBooleanField, providedByteField, providedCharField, providedDoubleField, providedFloatField, providedIntField, providedLongField, providedObjectField, providedShortField, providedStringField, replacingBooleanField, replacingByteField, replacingCharField, replacingDetachedState, replacingDoubleField, replacingFlags, replacingFloatField, replacingIntField, replacingLongField, replacingObjectField, replacingShortField, replacingStateManager, replacingStringField, setBooleanField, setByteField, setCharField, setDoubleField, setFloatField, setIntField, setLongField, setObjectField, setShortField, setStringField |
| Field Detail |
|---|
static final int PC
static final int EMBEDDED_PC
static final int EMBEDDED_COLLECTION_ELEMENT_PC
static final int EMBEDDED_MAP_KEY_PC
static final int EMBEDDED_MAP_VALUE_PC
| Method Detail |
|---|
javax.jdo.spi.PersistenceCapable getObject()
java.lang.Object getInternalObjectId()
java.lang.Object getExternalObjectId(javax.jdo.spi.PersistenceCapable pc)
pc - the PersistenceCapable object
PersistenceManager getPersistenceManager()
StoreManager getStoreManager()
MetaDataManager getMetaDataManager()
void makeDirty(int fieldNumber)
fieldNumber - The (absolute) field number of the fieldjava.lang.String[] getDirtyFieldNames()
java.lang.String[] getLoadedFieldNames()
void updateFieldAfterInsert(javax.jdo.spi.PersistenceCapable pc,
int fieldNumber)
pc - The Persistence Capable objectfieldNumber - The no of field to mark as dirty.
void changeActivityState(ActivityState activityState,
DatastoreClass table)
activityState - the activity statetable - Datastore class that has just been processedvoid runReachability(java.util.Set reachables)
reachables - List of reachable StateManagers so farvoid makeTransactional()
void makeNontransactional()
void makeTransient(FetchPlanState state)
state - Object containing the state of any fetch plan processingvoid makePersistent()
void makePersistentTransactionalTransient()
void deletePersistent()
java.lang.Object attachCopy(javax.jdo.spi.PersistenceCapable detachedPC,
boolean embedded)
detachedPC - the detached PersistenceCapable instance to be attachedembedded - Whether it is embedded
java.lang.Object detachCopy(FetchPlanState state)
state - State for the detachment process
void detach(FetchPlanState state)
state - State for the detachment processvoid validate()
void evict()
void refresh()
void retrieve(boolean fgOnly)
fgOnly - Whether to retrieve just the current fetch plan fieldsvoid retrieve(javax.jdo.FetchPlan fetchPlan)
fetchPlan - the fetch plan to load fieldsvoid postCommit(javax.jdo.Transaction tx)
tx - The transactionvoid preRollback(javax.jdo.Transaction tx)
tx - The transactionvoid flush()
java.lang.Object provideField(int fieldNumber)
fieldNumber - (absolute) field number of the field
void provideFields(int[] fieldNumbers,
FieldManager fm)
fieldNumbers - The numbers of the fieldsfm - The fieldManager
void replaceField(int fieldNumber,
java.lang.Object value)
fieldNumber - (absolute) field number of the fieldvalue - The new value.
void replaceFields(int[] fieldNumbers,
FieldManager fm,
boolean replaceDirtyFields)
fieldNumbers - (absolute) field numbers of the fields to updatefm - The FieldManagerreplaceDirtyFields - Whether to replace any dirty fields
void replaceFields(int[] fieldNumbers,
FieldManager fm)
fieldNumbers - (absolute) field numbers of the fields to updatefm - The FieldManager
void replaceNonLoadedFields(int[] fieldNumbers,
FieldManager fm)
fieldNumbers - (absolute) field numbers of the fields to updatefm - The FieldManager
java.lang.Object newSCOInstance(int fieldNumber,
java.lang.Object value,
boolean forUpdate)
fieldNumber - Number of the fieldvalue - The value to give itforUpdate - Whether it needs updating in the datastore
java.lang.Object replaceSCOField(int fieldNumber,
java.lang.Object value)
fieldNumber - value - the value to be wrapped
java.lang.Object newSCOEmptyInstance(int fieldNumber)
fieldNumber - (absolute) field number of the SCO field to wrap
java.lang.Object getAttachedPC()
boolean isInserting()
boolean isInserted(int fieldNumber)
fieldNumber - Number of the field
void setPostStoreNewObjectId(java.lang.Object id)
id - the id received from the datastorevoid setVersion(java.lang.Object version)
version - The versionjava.lang.Object getTransactionalVersion(javax.jdo.spi.PersistenceCapable pc)
pc - the calling PersistenceCapable instance
void setTransactionalVersion(java.lang.Object optimisticTransactionalVersion)
optimisticTransactionalVersion - int getHighestFieldNumber()
CachedPC getL2CacheableObject()
void dump(java.io.PrintWriter out)
out - The PrintWriterAbstractClassMetaData getClassMetaData()
void nullifyFields()
void loadUnloadedFieldsInFetchPlan()
void loadFieldsInFetchPlan(FetchPlanState state)
state - The FetchPlan statevoid loadUnloadedFieldsOfClassInFetchPlan(javax.jdo.FetchPlan fetchPlan)
fetchPlan - The FetchPlanvoid resetDetachState()
void disconnect()
void loadUnloadedFields()
void evictFromTransaction()
void enlistInTransaction()
void refreshLoadedFields()
void clearSavedFields()
void refreshFieldsInFetchPlan()
void clearNonPrimaryKeyFields()
void restoreFields()
void saveFields()
void clearFields()
void registerTransactional()
boolean isRestoreValues()
void clearLoadedFlags()
void addEmbeddedOwner(StateManager ownerSM,
int ownerFieldNumber)
ownerSM - The owning State Manager.ownerFieldNumber - The field number in the owner that the embedded/serialised object is stored asvoid loadFieldValues(FieldValues fv)
fv - Field Values to load (including any fetch plan to use when loading)void checkInheritance(FieldValues fv)
fv - the initial field values of the object.void retrieveDetachState(StateManager sm)
sm - The State Managervoid setPcObjectType(int embeddedType)
embeddedType - The type of object being managedvoid setStoringPC()
void unsetStoringPC()
boolean isEmbedded()
void unloadField(java.lang.String fieldName)
fieldName -
void setExternalFieldValueForMapping(JavaTypeMapping mapping,
java.lang.Object value)
mapping - The mapping for the (external) fieldvalue - The value that this field hasjava.lang.Object getValueForExternalField(JavaTypeMapping mapping)
mapping - The external field mapping
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||