Method Summary |
|
void | addEmbeddedOwner(StateManager ownerSM, int ownerFieldNumber) Method to register an owner StateManager with this embedded/serialised object. |
void | attach(boolean embedded) Method to attach the object managed by this StateManager. |
Object | attachCopy(Object detachedPC, boolean embedded) |
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 | checkManagedRelations() Method to process all managed relations for this object. |
void | clearFields() Method to clear all fields of the object. |
void | clearLoadedFlags() Method to clear all loaded flags on the object. |
void | clearManagedRelations() Method to clear any state related to "managed relationships" stored for the object.
This removes all original values stored for bidirectional fields that were changed in the
previous flush-cycle. |
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. |
Object | detachCopy(FetchPlanState state) |
void | disconnect() Disconnect the StateManager from the PersistenceManager and PC object. |
void | dump(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. |
public boolean | getAllFieldsLoaded() Returns whether all fields are loaded. |
AbstractClassMetaData | getClassMetaData() Accessor for the ClassMetaData for this object. |
String[] | getDirtyFieldNames() Accessor for the names of all dirty fields. |
public int[] | getDirtyFieldNumbers() Accessor for the field numbers of all dirty fields in this managed instance. |
public boolean[] | getDirtyFields() Creates a copy of the internal dirtyFields array. |
StateManager[] | getEmbeddedOwners() Accessor for the overall owner StateManagers of the managed object when embedded. |
Object | getExternalObjectId(Object obj) |
int | getHighestFieldNumber() |
Object | getInternalObjectId() Accessor for the id of the object managed by this StateManager. |
CachedPC | getL2CacheableObject() Accessor for an L2 cacheable form of this object. |
String[] | getLoadedFieldNames() Accessor for the names of all loaded fields. |
public int[] | getLoadedFieldNumbers() Accessor for the field numbers of all loaded fields in this managed instance. |
MetaDataManager | getMetaDataManager() Accessor for the manager for MetaData. |
Object | getObject() Accessor for the object managed by this StateManager. |
Object | getObjectId(PersistenceCapable pc) Accessor for the object id. |
ObjectManager | getObjectManager() |
int | getPcObjectType() Accessor for the PC object type. |
Object | getReferencedPC() Accessor for the referenced PC object when we are attaching or detaching. |
RelationshipManager | getRelationshipManager() Accessor for the relationship manager (if present). |
StoreManager | getStoreManager() Accessor for the manager for the store. |
Object | getTransactionalVersion(Object pc) Return the object representing the transactional version of the calling instance. |
Object | getValueForExternalField(JavaTypeMapping mapping) Accessor for the value of an external field. |
Object | getVersion(PersistenceCapable pc) |
void | initialiseForCachedPC(Object pc, Object id, boolean loaded, Class pcClass) Initialise to create a StateManager for a PersistenceCapable object, assigning the specified id to the object. |
void | initialiseForDetached(Object pc, Object id, Object version) Initialises the StateManager to manage a PersistenceCapable object in detached state. |
void | initialiseForEmbedded(Object pc, boolean copyPc) Initialises a state manager to manage a PersistenceCapable instance that will be EMBEDDED/SERIALISED
into another PersistenceCapable object. |
void | initialiseForHollow(Object id, FieldValues fv, Class pcClass) Initialises a state manager to manage a hollow instance having the given object ID and the given
(optional) field values. |
void | initialiseForHollowAppId(FieldValues fv, Class pcClass) Initialises a state manager to manage a HOLLOW / P_CLEAN instance having the given FieldValues. |
void | initialiseForHollowPreConstructed(Object id, Object pc) Initialises a state manager to manage the given hollow instance having the given object ID. |
void | initialiseForPNewToBeDeleted(Object pc) Initialises the StateManager to manage a PersistenceCapable object that is not persistent but that
is about to be deleted. |
void | initialiseForPersistentClean(Object id, Object pc) Initialises a state manager to manage the passed persistent instance having the given object ID.
Used where we have retrieved a PC object from a datastore directly (not field-by-field), for example on
an object datastore. |
void | initialiseForPersistentNew(Object pc, FieldValues preInsertChanges) Initialises a state manager to manage a transient instance that is becoming newly persistent. |
void | initialiseForTransactionalTransient(Object pc) Initialises a state manager to manage a Transactional Transient instance. |
boolean | isDeleted(PersistenceCapable pc) Accessor for whether the managed object is deleted. |
boolean | isDeleting() Tests whether this object is in the process of being deleted. |
public boolean | isDirty() Returns whether the object being managed is dirty. |
boolean | isEmbedded() Convenience accessor for whether this StateManager manages an embedded/serialised object. |
boolean | isInserted(int fieldNumber) Returns whether the specified field of this object is inserted in the datastore. |
boolean | isInserted(String className) Returns whether this object is inserted in the datastore far enough to be considered
of the supplied type. |
boolean | isInserting() Tests whether this object is being inserted. |
boolean | isLoaded(PersistenceCapable pc, int fieldNumber) |
boolean | isNew(PersistenceCapable pc) Accessor for whether the managed object is new. |
boolean | isRestoreValues() |
boolean | isWaitingToBeFlushedToDatastore() Tests whether this object is new yet waiting to be flushed to the datastore. |
void | loadField(int fieldNumber) Convenience method to load the specified field if not loaded. |
void | loadFieldFromDatastore(int fieldNumber) Convenience method to load a field from the datastore. |
void | loadFieldValues(FieldValues fv) Convenience method to load the passed field values. |
void | loadFieldsInFetchPlan(FetchPlanState state) Method to load all unloaded fields in the FetchPlan. |
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(FetchPlan fetchPlan) Loads all unloaded fields of the managed class that are in the current FetchPlan. |
void | locate() Locate this object in the datastore. |
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() |
void | makeTransactional() Method to make the managed object transactional. |
void | makeTransient(FetchPlanState state) Method to make the managed object transient. |
void | nullifyFields() |
void | postCommit(Transaction tx) Convenience interceptor to allow operations to be performed after the commit is performed
but before returning control to the application. |
void | preBegin(Transaction tx) |
void | preRollback(Transaction tx) Convenience interceptor to allow operations to be performed before any rollback is
performed. |
void | processManagedRelations() Method to process all managed relations for this object. |
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() |
void | replaceAllLoadedSCOFieldsWithValues() Method to replace all loaded (wrapped) SCO fields with unwrapped values. |
void | replaceAllLoadedSCOFieldsWithWrappers() Method to replace all loaded SCO fields with wrappers. |
void | replaceField(int fieldNumber, Object value, boolean makeDirty) Method to change the value of the specified field. |
void | replaceFieldValue(int fieldNumber, Object newValue) Convenience method to change the value of a field that is assumed loaded. |
void | replaceFields(int fieldNumbers, FieldManager fm, boolean replaceWhenDirty) |
void | replaceFields(int fieldNumbers, FieldManager fm) |
void | replaceManagedPC(PersistenceCapable pc) Method to swap the managed object for the supplied object.
This is of particular use for object datastores where the datastore is responsible for creating
the in-memory object and where we have a temporary object that we want to swap for the datastore
generated object. |
void | replaceNonLoadedFields(int fieldNumbers, FieldManager fm) Method to update the data in the object with the values from the passed
FieldManager. |
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(FetchPlan fetchPlan) Method to retrieve the object. |
void | retrieveDetachState(org.jpox.StateManager sm) |
void | runReachability(Set reachables) Method to run reachability from this StateManager. |
void | saveFields() Method to save all fields of the object. |
void | setExternalFieldValueForMapping(JavaTypeMapping mapping, Object value) |
void | setObjectField(PersistenceCapable pc, int fieldNumber, Object oldValue, Object newValue) |
void | setPcObjectType(int embeddedType) Method to set this StateManager as managing an embedded/serialised object. |
void | setPostStoreNewObjectId(Object id) Method to allow the setting of the id of the PC object. |
void | setStoringPC() Method to set the storing PC flag. |
void | setTransactionalVersion(Object optimisticTransactionalVersion) |
void | setVersion(Object version) Sets the value for the version column in the datastore. |
void | unloadField(String fieldName) Mark the specified field as not loaded so that it will be reloaded on next access. |
void | unloadNonFetchPlanFields() Method that will unload all fields that are not in the FetchPlan. |
void | unsetStoringPC() Method to unset the storing PC flag. |
Object | unwrapSCOField(int fieldNumber, Object value, boolean replaceFieldIfChanged) Method to unwrap a SCO field (if it is wrapped currently) and return the unwrapped value. |
void | updateFieldAfterInsert(Object pc, int fieldNumber) Marks the given field dirty for issuing an update after the insert.
Parameters: pc - The Persistable object Parameters: fieldNumber - The no of field to mark as dirty. |
void | validate() Validates whether the persistence capable instance exists in the
datastore. |
Object | wrapSCOField(int fieldNumber, Object value, boolean forInsert, boolean forUpdate, boolean replaceFieldIfChanged) Method to wrap a SCO field (if not wrapped currently) and return the wrapped value. |