|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.state.StateManagerImpl
Implementation of the StateManager. Implemented here as one StateManager per Object so adds on functionality particular to each object. All PersistenceCapable objects will have a StateManager when they have had communication with the PersistenceManager. They will typically always have an identity also. The exception to that is for embedded/serialised objects.
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 |
protected static Localiser |
LOCALISER
Localiser for messages. |
protected javax.jdo.spi.PersistenceCapable |
myPC
The PersistenceCapable instance managed by this StateManager |
static int |
PC
PC |
Constructor Summary | |
StateManagerImpl(javax.jdo.spi.PersistenceCapable pc,
AbstractClassMetaData cmd,
java.lang.Object id,
java.lang.Object version)
Constructor for creating SM instances to manage PersistenceCapable objects in detached state |
|
StateManagerImpl(javax.jdo.spi.PersistenceCapable pc,
PersistenceManager pm,
boolean copyPc)
Constructs a state manager to manage a PersistenceCapable instance that will be EMBEDDED/SERIALISED into another PersistenceCapable object. |
|
StateManagerImpl(PersistenceManager pm,
java.lang.Class pcClass,
FieldValues fv)
Constructs a state manager to manage a hollow or pclean instance having the given FieldValues. |
|
StateManagerImpl(PersistenceManager pm,
java.lang.Class pcClass,
java.lang.Object id)
Constructs a state manager to manage a hollow instance having the given object ID. |
|
StateManagerImpl(PersistenceManager pm,
java.lang.Class pcClass,
java.lang.Object id,
FieldValues fv)
Constructs a state manager to manage a recently populated hollow instance having the given object ID and the given field values. |
|
StateManagerImpl(PersistenceManager pm,
java.lang.Object id,
javax.jdo.spi.PersistenceCapable pc,
boolean[] loaded)
Constructor to create a StateManager for a PersistenceCapable object, assigning the specified id to the object. |
|
StateManagerImpl(PersistenceManager pm,
javax.jdo.spi.PersistenceCapable pc)
Constructs a state manager to manage a Transactional Transient instance. |
|
StateManagerImpl(PersistenceManager pm,
javax.jdo.spi.PersistenceCapable pc,
FieldValues preInsertChanges)
Constructs a state manager to manage a transient instance that is becoming newly persistent. |
Method Summary | |
void |
addEmbeddedOwner(javax.jdo.spi.StateManager ownerSM,
int ownerFieldNumber)
Method to register an owner StateManager with this embedded/serialised object. |
void |
addInsertionNotifier(javax.jdo.spi.StateManager sm,
ActivityState activityState)
Method to add a notifier that we must contact when we have finished our insertion. |
java.lang.Object |
attachCopy(javax.jdo.spi.PersistenceCapable detachedPC,
boolean embedded)
Method to attach the detached PersistenceCapable instance |
void |
changeActivityState(ActivityState activityState)
Change the activity state. |
void |
checkInheritance(FieldValues fv)
Look to the database to determine which class this object is. |
void |
deletePersistent()
Method to delete the object from persistence. |
void |
detach(FetchPlanState state)
Method to detach this 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)
Utility to dump the contents of the StateManager. |
void |
evict()
Method to change the object state to evicted. |
void |
flush()
Flushes any dirty fields to the data store. |
boolean |
getBooleanField(javax.jdo.spi.PersistenceCapable pc,
int field,
boolean currentValue)
This method is called by the associated PersistenceCapable if the value for the specified field is not cached (StateManager.isLoaded() fails). |
byte |
getByteField(javax.jdo.spi.PersistenceCapable pc,
int field,
byte currentValue)
This method is called by the associated PersistenceCapable if the value for the specified field is not cached (StateManager.isLoaded() fails). |
char |
getCharField(javax.jdo.spi.PersistenceCapable pc,
int field,
char currentValue)
This method is called by the associated PersistenceCapable if the value for the specified field is not cached (StateManager.isLoaded() fails). |
AbstractClassMetaData |
getClassMetaData()
Accessor for the ClassMetaData for this object. |
java.lang.String[] |
getDirtyFieldNames()
Accessor for the names of the fields that are dirty. |
double |
getDoubleField(javax.jdo.spi.PersistenceCapable pc,
int field,
double currentValue)
This method is called by the associated PersistenceCapable if the value for the specified field is not cached (StateManager.isLoaded() fails). |
java.lang.Object |
getExternalObjectId(javax.jdo.spi.PersistenceCapable pc)
Return an object id that the user can use. |
float |
getFloatField(javax.jdo.spi.PersistenceCapable pc,
int field,
float currentValue)
This method is called by the associated PersistenceCapable if the value for the specified field is not cached (StateManager.isLoaded() fails). |
int |
getHighestFieldNumber()
Accessor for the highest field number in this class |
java.lang.Object |
getInternalObjectId()
Accessor for the internal object id of the object we are managing. |
int |
getIntField(javax.jdo.spi.PersistenceCapable pc,
int field,
int currentValue)
This method is called by the associated PersistenceCapable if the value for the specified field is not cached (StateManager.isLoaded() fails). |
CachedPC |
getL2CacheableObject()
Accessor for a L2-Cacheable form of this PersistenceCapable object. |
LifeCycleState |
getLifecycleState()
Accessor for the LifeCycleState |
java.lang.String[] |
getLoadedFieldNames()
Accessor for the names of the fields that are loaded. |
long |
getLongField(javax.jdo.spi.PersistenceCapable pc,
int field,
long currentValue)
This method is called by the associated PersistenceCapable if the value for the specified field is not cached (StateManager.isLoaded() fails). |
MetaDataManager |
getMetaDataManager()
Accessor for the MetaDataManager to use for this object. |
javax.jdo.spi.PersistenceCapable |
getObject()
Accessor for the Persistent Capable object. |
java.lang.Object |
getObjectField(javax.jdo.spi.PersistenceCapable pc,
int field,
java.lang.Object currentValue)
This method is called by the associated PersistenceCapable if the value for the specified field is not cached (StateManager.isLoaded() fails). |
java.lang.Object |
getObjectId(javax.jdo.spi.PersistenceCapable pc)
Return the object representing the JDO identity of the calling instance. |
PersistenceManager |
getPersistenceManager()
Accessor for the PersistenceManager for this object. |
javax.jdo.PersistenceManager |
getPersistenceManager(javax.jdo.spi.PersistenceCapable pc)
Accessor for the PersistenceManager that owns this instance. |
short |
getShortField(javax.jdo.spi.PersistenceCapable pc,
int field,
short currentValue)
This method is called by the associated PersistenceCapable if the value for the specified field is not cached (StateManager.isLoaded() fails). |
StoreManager |
getStoreManager()
Accessor for the StoreManager used for this object. |
java.lang.String |
getStringField(javax.jdo.spi.PersistenceCapable pc,
int field,
java.lang.String currentValue)
This method is called by the associated PersistenceCapable if the value for the specified field is not cached (StateManager.isLoaded() fails). |
java.lang.Object |
getTransactionalObjectId(javax.jdo.spi.PersistenceCapable pc)
Return the object representing the JDO identity of the calling instance. |
java.lang.Object |
getTransactionalVersion(javax.jdo.spi.PersistenceCapable pc)
Return the object representing the transactional version of the calling instance. |
java.lang.Object |
getVersion(javax.jdo.spi.PersistenceCapable pc)
Return the object representing the version of the calling instance. |
boolean |
isDeleted(javax.jdo.spi.PersistenceCapable pc)
Tests whether this object has been deleted. |
boolean |
isDirty(javax.jdo.spi.PersistenceCapable pc)
Tests whether this object is dirty. |
boolean |
isEmbedded()
Convenience accessor for whether this StateManager manages an embedded/serialised object. |
boolean |
isInserting()
Tests whether this object is being inserted. |
boolean |
isLoaded(javax.jdo.spi.PersistenceCapable pc,
int field)
Return true if the field is cached in the calling instance. |
boolean |
isNew(javax.jdo.spi.PersistenceCapable pc)
Tests whether this object has been newly made persistent. |
boolean |
isPersistent(javax.jdo.spi.PersistenceCapable pc)
Tests whether this object is persistent. |
boolean |
isRestoreValues()
Accessor for the Restore Values flag |
boolean |
isTransactional(javax.jdo.spi.PersistenceCapable pc)
Tests whether this object is transactional. |
void |
loadFieldValues(FieldValues fv)
Convenience method to load the passed field values. |
void |
loadUnloadedFieldsInFetchPlan()
Fetchs from the database all fields that are not currently loaded and that are in the current fetch group. |
void |
loadUnloadedFieldsInFetchPlan(javax.jdo.FetchPlan fetchPlan)
Fetchs from the database all fields in the actual fetch plan. |
void |
makeDirty(int field)
Marks the given field dirty. |
void |
makeDirty(javax.jdo.spi.PersistenceCapable pc,
java.lang.String fieldName)
Mark the associated PersistenceCapable field dirty. |
void |
makeNontransactional()
Method to change the object state to nontransactional. |
void |
makePersistent()
Method to make the object persistent. |
void |
makePersistentTransactionalTransient()
Makes Transactional Transient instances persistent |
void |
makeTransactional()
Method to change the object state to transactional. |
void |
makeTransient(FetchPlanState state)
Method to change the object state to transient. |
java.lang.Object |
newSCOEmptyInstance(int fieldNumber)
Method to create a new SCO proxy wraper object for a field. |
java.lang.Object |
newSCOInstance(int fieldNumber,
java.lang.Object value,
boolean forUpdate)
Method to store a new SCO field at the specified field number. |
void |
nullifyFields()
Nullify fields with reference to PersistenceCapable or SCO instances |
void |
postCommit(javax.jdo.Transaction tx)
This method is invoked when a commit is performed in a Transaction involving the PersistenceCapable managed by this StateManager |
void |
preRollback(javax.jdo.Transaction tx)
This method is invoked when a rollback is performed in a Transaction involving the PersistenceCapable managed by this StateManager. |
void |
preSerialize(javax.jdo.spi.PersistenceCapable pc)
Guarantee that the serializable transactional and persistent fields are loaded into the instance. |
void |
providedBooleanField(javax.jdo.spi.PersistenceCapable pc,
int field,
boolean currentValue)
This method is called from the associated PersistenceCapable when its PersistenceCapable.jdoProvideFields() method is invoked. |
void |
providedByteField(javax.jdo.spi.PersistenceCapable pc,
int field,
byte currentValue)
This method is called from the associated PersistenceCapable when its PersistenceCapable.jdoProvideFields() method is invoked. |
void |
providedCharField(javax.jdo.spi.PersistenceCapable pc,
int field,
char currentValue)
This method is called from the associated PersistenceCapable when its PersistenceCapable.jdoProvideFields() method is invoked. |
void |
providedDoubleField(javax.jdo.spi.PersistenceCapable pc,
int field,
double currentValue)
This method is called from the associated PersistenceCapable when its PersistenceCapable.jdoProvideFields() method is invoked. |
void |
providedFloatField(javax.jdo.spi.PersistenceCapable pc,
int field,
float currentValue)
This method is called from the associated PersistenceCapable when its PersistenceCapable.jdoProvideFields() method is invoked. |
void |
providedIntField(javax.jdo.spi.PersistenceCapable pc,
int field,
int currentValue)
This method is called from the associated PersistenceCapable when its PersistenceCapable.jdoProvideFields() method is invoked. |
void |
providedLongField(javax.jdo.spi.PersistenceCapable pc,
int field,
long currentValue)
This method is called from the associated PersistenceCapable when its PersistenceCapable.jdoProvideFields() method is invoked. |
void |
providedObjectField(javax.jdo.spi.PersistenceCapable pc,
int fieldNumber,
java.lang.Object currentValue)
This method is called from the associated PersistenceCapable when its PersistenceCapable.jdoProvideFields() method is invoked. |
void |
providedShortField(javax.jdo.spi.PersistenceCapable pc,
int field,
short currentValue)
This method is called from the associated PersistenceCapable when its PersistenceCapable.jdoProvideFields() method is invoked. |
void |
providedStringField(javax.jdo.spi.PersistenceCapable pc,
int field,
java.lang.String currentValue)
This method is called from the associated PersistenceCapable when its PersistenceCapable.jdoProvideFields() method is invoked. |
java.lang.Object |
provideField(int fieldNumber)
Method to return the current value of a particular field. |
void |
provideFields(int[] fieldNumbers,
FieldManager fm)
Called from the StoreManager after StoreManager.update() is called to obtain updated values from the PersistenceCapable associated with this StateManager. |
void |
refresh()
Method to refresh the object. |
void |
registerTransactional()
Registers the pc class in the cache |
void |
removeEmbeddedOwner(javax.jdo.spi.StateManager ownerSM,
int ownerFieldNumber)
Method to remove an owner StateManager from this embedded/serialised objects owners list. |
void |
replaceField(int fieldNumber,
java.lang.Object value)
Method to change the value of a particular field. |
void |
replaceFields(int[] fieldNumbers,
FieldManager fm)
Called from the StoreManager to refresh data in the PersistenceCapable object associated with this StateManager. |
void |
replaceNonLoadedFields(int[] fieldNumbers,
FieldManager fm)
Called from the StoreManager to refresh data in the PersistenceCapable object associated with this StateManager. |
java.lang.Object |
replaceSCOField(int fieldNumber,
java.lang.Object value)
Method to replace a second-class object field value. |
boolean |
replacingBooleanField(javax.jdo.spi.PersistenceCapable pc,
int field)
This method is invoked by the PersistenceCapable object's jdoReplaceField() method to refresh the value of a boolean field. |
byte |
replacingByteField(javax.jdo.spi.PersistenceCapable obj,
int field)
This method is invoked by the PersistenceCapable object's jdoReplaceField() method to refresh the value of a byte field. |
char |
replacingCharField(javax.jdo.spi.PersistenceCapable obj,
int field)
This method is invoked by the PersistenceCapable object's jdoReplaceField() method to refresh the value of a char field. |
java.lang.Object[] |
replacingDetachedState(javax.jdo.spi.Detachable pc,
java.lang.Object[] currentState)
Method to update the "detached state" in the detached object to obtain the "detached state" from the detached object, or to reset it (to null). |
double |
replacingDoubleField(javax.jdo.spi.PersistenceCapable obj,
int field)
This method is invoked by the PersistenceCapable object's jdoReplaceField() method to refresh the value of a double field. |
byte |
replacingFlags(javax.jdo.spi.PersistenceCapable pc)
The StateManager uses this method to supply the value of jdoFlags to the associated PersistenceCapable instance. |
float |
replacingFloatField(javax.jdo.spi.PersistenceCapable obj,
int field)
This method is invoked by the PersistenceCapable object's jdoReplaceField() method to refresh the value of a float field. |
int |
replacingIntField(javax.jdo.spi.PersistenceCapable obj,
int field)
This method is invoked by the PersistenceCapable object's jdoReplaceField() method to refresh the value of a int field. |
long |
replacingLongField(javax.jdo.spi.PersistenceCapable obj,
int field)
This method is invoked by the PersistenceCapable object's jdoReplaceField() method to refresh the value of a long field. |
java.lang.Object |
replacingObjectField(javax.jdo.spi.PersistenceCapable obj,
int field)
This method is invoked by the PersistenceCapable object's jdoReplaceField() method to refresh the value of an Object field. |
short |
replacingShortField(javax.jdo.spi.PersistenceCapable obj,
int field)
This method is invoked by the PersistenceCapable object's jdoReplaceField() method to refresh the value of a short field. |
javax.jdo.spi.StateManager |
replacingStateManager(javax.jdo.spi.PersistenceCapable pc,
javax.jdo.spi.StateManager sm)
Replace the current value of jdoStateManager. |
java.lang.String |
replacingStringField(javax.jdo.spi.PersistenceCapable obj,
int field)
This method is invoked by the PersistenceCapable object's jdoReplaceField() method to refresh the value of a String field. |
void |
resetDetachState()
Convenience method to reset the detached state in the current object. |
void |
retrieve(boolean fgOnly)
Method to retrieve the object. |
void |
retrieve(javax.jdo.FetchPlan fetchPlan)
Method to retrieve the object. |
void |
retrieveDetachState(StateManagerImpl sm)
Convenience method to retrieve the detach state from the passed State Manager's object |
void |
runReachability(java.util.Set reachables)
Method to mark an object for reachability. |
void |
setBooleanField(javax.jdo.spi.PersistenceCapable pc,
int field,
boolean currentValue,
boolean newValue)
This method is called by the associated PersistenceCapable when the corresponding mutator method (setXXX()) is called on the PersistenceCapable. |
void |
setByteField(javax.jdo.spi.PersistenceCapable pc,
int field,
byte currentValue,
byte newValue)
This method is called by the associated PersistenceCapable when the corresponding mutator method (setXXX()) is called on the PersistenceCapable. |
void |
setCharField(javax.jdo.spi.PersistenceCapable pc,
int field,
char currentValue,
char newValue)
This method is called by the associated PersistenceCapable when the corresponding mutator method (setXXX()) is called on the PersistenceCapable. |
void |
setDoubleField(javax.jdo.spi.PersistenceCapable pc,
int field,
double currentValue,
double newValue)
This method is called by the associated PersistenceCapable when the corresponding mutator method (setXXX()) is called on the PersistenceCapable. |
void |
setFloatField(javax.jdo.spi.PersistenceCapable pc,
int field,
float currentValue,
float newValue)
This method is called by the associated PersistenceCapable when the corresponding mutator method (setXXX()) is called on the PersistenceCapable. |
void |
setIntField(javax.jdo.spi.PersistenceCapable pc,
int field,
int currentValue,
int newValue)
This method is called by the associated PersistenceCapable when the corresponding mutator method (setXXX()) is called on the PersistenceCapable. |
void |
setLongField(javax.jdo.spi.PersistenceCapable pc,
int field,
long currentValue,
long newValue)
This method is called by the associated PersistenceCapable when the corresponding mutator method (setXXX()) is called on the PersistenceCapable. |
void |
setObjectField(javax.jdo.spi.PersistenceCapable pc,
int field,
java.lang.Object currentValue,
java.lang.Object newValue)
This method is called by the associated PersistenceCapable when the corresponding mutator method (setXXX()) is called on the PersistenceCapable. |
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 |
setShortField(javax.jdo.spi.PersistenceCapable pc,
int field,
short currentValue,
short newValue)
This method is called by the associated PersistenceCapable when the corresponding mutator method (setXXX()) is called on the PersistenceCapable. |
void |
setStoringPC()
Method to set the storing PC flag. |
void |
setStringField(javax.jdo.spi.PersistenceCapable pc,
int field,
java.lang.String currentValue,
java.lang.String newValue)
This method is called by the associated PersistenceCapable when the corresponding mutator method (setXXX()) is called on the PersistenceCapable. |
void |
setTransactionalVersion(java.lang.Object version)
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 |
unsetStoringPC()
Method to unset the storing PC flag. |
void |
updateFieldAfterInsert(javax.jdo.spi.PersistenceCapable pc,
int fieldNumber)
Marks the given field as being required to be updated when the specified object has been inserted. |
void |
validate()
Validates whether the persistence capable instance exists in the datastore. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final Localiser LOCALISER
protected javax.jdo.spi.PersistenceCapable myPC
public static int PC
public static int EMBEDDED_PC
public static int EMBEDDED_COLLECTION_ELEMENT_PC
public static int EMBEDDED_MAP_KEY_PC
public static int EMBEDDED_MAP_VALUE_PC
Constructor Detail |
public StateManagerImpl(PersistenceManager pm, java.lang.Class pcClass, java.lang.Object id)
PersistenceManager.getObjectById(Object, boolean, boolean)
).
pm
- the persistence manager controlling this state manager.pcClass
- the class of the new instance to be created.id
- the JDO identity of the object.public StateManagerImpl(javax.jdo.spi.PersistenceCapable pc, PersistenceManager pm, boolean copyPc)
pc
- The PersistenceCapable to manage (see copyPc also)pm
- The persistence manager controlling this state manager.copyPc
- Whether the SM should manage a copy of the passed PC or that onepublic StateManagerImpl(PersistenceManager pm, java.lang.Class pcClass, FieldValues fv)
PersistenceManager.getObjectByAID(java.lang.Class, org.jpox.store.FieldValues, boolean, boolean)
pm
- the persistence manager controlling this state manager.pcClass
- the class of the new instance to be created.fv
- the initial field values of the object.public StateManagerImpl(PersistenceManager pm, java.lang.Class pcClass, java.lang.Object id, FieldValues fv)
PersistenceManager.getObjectById(Object,FieldValues)
).
pm
- the persistence manager controlling this state manager.pcClass
- the class of the new instance to be created.id
- the JDO identity of the object.fv
- the initial field values of the object.public StateManagerImpl(PersistenceManager pm, javax.jdo.spi.PersistenceCapable pc, FieldValues preInsertChanges)
This constructor is used for assigning state managers to existing
instances that are transitioning to a persistent state (i.e. via
PersistenceManager.makePersistent(Object)
).
pm
- the persistence manager controlling this state manager.pc
- the instance being make persistent.preInsertChanges
- Any changes to make before insertingpublic StateManagerImpl(PersistenceManager pm, javax.jdo.spi.PersistenceCapable pc)
This constructor is used for assigning state managers to Transient
instances that are transitioning to a transient clean state (i.e. via
PersistenceManager.makeTransactional(Object)
).
pm
- the persistence manager controlling this state manager.pc
- the instance being make persistent.public StateManagerImpl(javax.jdo.spi.PersistenceCapable pc, AbstractClassMetaData cmd, java.lang.Object id, java.lang.Object version)
pc
- the detach object.cmd
- the AbstractClassMetaDataid
- the JDO identity of the object.version
- the detached versionpublic StateManagerImpl(PersistenceManager pm, java.lang.Object id, javax.jdo.spi.PersistenceCapable pc, boolean[] loaded)
pm
- PersistenceManager managing this objectid
- Id to assign to the PersistenceCapable objectpc
- The PersistenceCapable objectloaded
- The list of loaded fields (when put in the cache)Method Detail |
public void checkInheritance(FieldValues fv)
fv
- the initial field values of the object.public void loadFieldValues(FieldValues fv)
fv
- Field Values to load (including any fetch plan to use when loading)public CachedPC getL2CacheableObject()
getL2CacheableObject
in interface StateManager
public java.lang.String[] getDirtyFieldNames()
getDirtyFieldNames
in interface StateManager
public java.lang.String[] getLoadedFieldNames()
getLoadedFieldNames
in interface StateManager
public void makeDirty(int field)
makeDirty
in interface StateManager
field
- The no of field to mark as dirty.public void makeDirty(javax.jdo.spi.PersistenceCapable pc, java.lang.String fieldName)
makeDirty
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefieldName
- the name of the fieldpublic StoreManager getStoreManager()
getStoreManager
in interface StateManager
public AbstractClassMetaData getClassMetaData()
getClassMetaData
in interface StateManager
public MetaDataManager getMetaDataManager()
getMetaDataManager
in interface StateManager
public javax.jdo.PersistenceManager getPersistenceManager(javax.jdo.spi.PersistenceCapable pc)
getPersistenceManager
in interface javax.jdo.spi.StateManager
pc
- The PersistenceCapable instance
public PersistenceManager getPersistenceManager()
getPersistenceManager
in interface StateManager
public javax.jdo.spi.PersistenceCapable getObject()
getObject
in interface StateManager
public boolean isRestoreValues()
public java.lang.Object getObjectId(javax.jdo.spi.PersistenceCapable pc)
getObjectId
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
public java.lang.Object getInternalObjectId()
getInternalObjectId
in interface StateManager
public void setPostStoreNewObjectId(java.lang.Object id)
setPostStoreNewObjectId
in interface StateManager
id
- the id received from the datastorepublic java.lang.Object getExternalObjectId(javax.jdo.spi.PersistenceCapable pc)
getExternalObjectId
in interface StateManager
pc
- the PersistenceCapable object
public javax.jdo.spi.StateManager replacingStateManager(javax.jdo.spi.PersistenceCapable pc, javax.jdo.spi.StateManager sm)
This method is called by the PersistenceCapable whenever jdoReplaceStateManager is called and there is already an owning StateManager. This is a security precaution to ensure that the owning StateManager is the only source of any change to its reference in the PersistenceCapable.
replacingStateManager
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancesm
- the proposed new value for the jdoStateManager
public java.lang.Object getTransactionalObjectId(javax.jdo.spi.PersistenceCapable pc)
getTransactionalObjectId
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
public boolean isDirty(javax.jdo.spi.PersistenceCapable pc)
Transient nontransactional instances return false (JDO spec), but the JPOX implementation does not currently support the transient transactional state.
isDirty
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
PersistenceCapable.jdoMakeDirty(String fieldName)
public boolean isTransactional(javax.jdo.spi.PersistenceCapable pc)
Transient nontransactional instances return false.
isTransactional
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
public boolean isPersistent(javax.jdo.spi.PersistenceCapable pc)
Transient instances return false.
isPersistent
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
PersistenceManager.makePersistent(Object pc)
public boolean isNew(javax.jdo.spi.PersistenceCapable pc)
Transient instances return false.
isNew
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
PersistenceManager.makePersistent(Object pc)
public boolean isDeleted(javax.jdo.spi.PersistenceCapable pc)
Transient instances return false.
isDeleted
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
PersistenceManager.deletePersistent(Object pc)
public void loadUnloadedFieldsInFetchPlan()
loadUnloadedFieldsInFetchPlan
in interface StateManager
public void loadUnloadedFieldsInFetchPlan(javax.jdo.FetchPlan fetchPlan)
public boolean isLoaded(javax.jdo.spi.PersistenceCapable pc, int field)
In the JPOX implementation of this method, isLoaded() will always return true. If the field is not loaded, it will be loaded as a side effect of the call to this method. If it is in the default fetch group, the default fetch group, including this field, will be loaded.
isLoaded
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the absolute field number
public boolean getBooleanField(javax.jdo.spi.PersistenceCapable pc, int field, boolean currentValue)
getBooleanField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
public byte getByteField(javax.jdo.spi.PersistenceCapable pc, int field, byte currentValue)
getByteField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
public char getCharField(javax.jdo.spi.PersistenceCapable pc, int field, char currentValue)
getCharField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
public double getDoubleField(javax.jdo.spi.PersistenceCapable pc, int field, double currentValue)
getDoubleField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
public float getFloatField(javax.jdo.spi.PersistenceCapable pc, int field, float currentValue)
getFloatField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
public int getIntField(javax.jdo.spi.PersistenceCapable pc, int field, int currentValue)
getIntField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
public long getLongField(javax.jdo.spi.PersistenceCapable pc, int field, long currentValue)
getLongField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
public short getShortField(javax.jdo.spi.PersistenceCapable pc, int field, short currentValue)
getShortField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
public java.lang.String getStringField(javax.jdo.spi.PersistenceCapable pc, int field, java.lang.String currentValue)
getStringField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
public java.lang.Object getObjectField(javax.jdo.spi.PersistenceCapable pc, int field, java.lang.Object currentValue)
getObjectField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
public void setBooleanField(javax.jdo.spi.PersistenceCapable pc, int field, boolean currentValue, boolean newValue)
setBooleanField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the new value for the fieldpublic void setByteField(javax.jdo.spi.PersistenceCapable pc, int field, byte currentValue, byte newValue)
setByteField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the new value for the fieldpublic void setCharField(javax.jdo.spi.PersistenceCapable pc, int field, char currentValue, char newValue)
setCharField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the new value for the fieldpublic void setDoubleField(javax.jdo.spi.PersistenceCapable pc, int field, double currentValue, double newValue)
setDoubleField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the new value for the fieldpublic void setFloatField(javax.jdo.spi.PersistenceCapable pc, int field, float currentValue, float newValue)
setFloatField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the new value for the fieldpublic void setIntField(javax.jdo.spi.PersistenceCapable pc, int field, int currentValue, int newValue)
setIntField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the new value for the fieldpublic void setLongField(javax.jdo.spi.PersistenceCapable pc, int field, long currentValue, long newValue)
setLongField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the new value for the fieldpublic void setShortField(javax.jdo.spi.PersistenceCapable pc, int field, short currentValue, short newValue)
setShortField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the new value for the fieldpublic void setStringField(javax.jdo.spi.PersistenceCapable pc, int field, java.lang.String currentValue, java.lang.String newValue)
setStringField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the new value for the fieldpublic void setObjectField(javax.jdo.spi.PersistenceCapable pc, int field, java.lang.Object currentValue, java.lang.Object newValue)
setObjectField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the new value for the fieldpublic void providedBooleanField(javax.jdo.spi.PersistenceCapable pc, int field, boolean currentValue)
providedBooleanField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldpublic void providedByteField(javax.jdo.spi.PersistenceCapable pc, int field, byte currentValue)
providedByteField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldpublic void providedCharField(javax.jdo.spi.PersistenceCapable pc, int field, char currentValue)
providedCharField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldpublic void providedDoubleField(javax.jdo.spi.PersistenceCapable pc, int field, double currentValue)
providedDoubleField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldpublic void providedFloatField(javax.jdo.spi.PersistenceCapable pc, int field, float currentValue)
providedFloatField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldpublic void providedIntField(javax.jdo.spi.PersistenceCapable pc, int field, int currentValue)
providedIntField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldpublic void providedLongField(javax.jdo.spi.PersistenceCapable pc, int field, long currentValue)
providedLongField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldpublic void providedShortField(javax.jdo.spi.PersistenceCapable pc, int field, short currentValue)
providedShortField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldpublic void providedStringField(javax.jdo.spi.PersistenceCapable pc, int field, java.lang.String currentValue)
providedStringField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field numbercurrentValue
- the current value of the fieldpublic void providedObjectField(javax.jdo.spi.PersistenceCapable pc, int fieldNumber, java.lang.Object currentValue)
providedObjectField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefieldNumber
- the field numbercurrentValue
- the current value of the fieldpublic byte replacingFlags(javax.jdo.spi.PersistenceCapable pc)
replacingFlags
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
public boolean replacingBooleanField(javax.jdo.spi.PersistenceCapable pc, int field)
replacingBooleanField
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field number
public byte replacingByteField(javax.jdo.spi.PersistenceCapable obj, int field)
replacingByteField
in interface javax.jdo.spi.StateManager
obj
- the calling PersistenceCapable instancefield
- the field number
public char replacingCharField(javax.jdo.spi.PersistenceCapable obj, int field)
replacingCharField
in interface javax.jdo.spi.StateManager
obj
- the calling PersistenceCapable instancefield
- the field number
public double replacingDoubleField(javax.jdo.spi.PersistenceCapable obj, int field)
replacingDoubleField
in interface javax.jdo.spi.StateManager
obj
- the calling PersistenceCapable instancefield
- the field number
public float replacingFloatField(javax.jdo.spi.PersistenceCapable obj, int field)
replacingFloatField
in interface javax.jdo.spi.StateManager
obj
- the calling PersistenceCapable instancefield
- the field number
public int replacingIntField(javax.jdo.spi.PersistenceCapable obj, int field)
replacingIntField
in interface javax.jdo.spi.StateManager
obj
- the calling PersistenceCapable instancefield
- the field number
public long replacingLongField(javax.jdo.spi.PersistenceCapable obj, int field)
replacingLongField
in interface javax.jdo.spi.StateManager
obj
- the calling PersistenceCapable instancefield
- the field number
public short replacingShortField(javax.jdo.spi.PersistenceCapable obj, int field)
replacingShortField
in interface javax.jdo.spi.StateManager
obj
- the calling PersistenceCapable instancefield
- the field number
public java.lang.String replacingStringField(javax.jdo.spi.PersistenceCapable obj, int field)
replacingStringField
in interface javax.jdo.spi.StateManager
obj
- the calling PersistenceCapable instancefield
- the field number
public java.lang.Object replacingObjectField(javax.jdo.spi.PersistenceCapable obj, int field)
replacingObjectField
in interface javax.jdo.spi.StateManager
obj
- the calling PersistenceCapable instancefield
- the field number
public java.lang.Object provideField(int fieldNumber)
provideField
in interface StateManager
fieldNumber
- Number of field
public void replaceField(int fieldNumber, java.lang.Object value)
replaceField
in interface StateManager
fieldNumber
- Number of fieldvalue
- New valuepublic void provideFields(int[] fieldNumbers, FieldManager fm)
provideFields
in interface StateManager
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 void replaceFields(int[] fieldNumbers, FieldManager fm)
replaceFields
in interface StateManager
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.public void replaceNonLoadedFields(int[] fieldNumbers, FieldManager fm)
replaceNonLoadedFields
in interface StateManager
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.public boolean isEmbedded()
public void setPcObjectType(int embeddedType)
embeddedType
- The type of object being managedpublic void addEmbeddedOwner(javax.jdo.spi.StateManager ownerSM, int ownerFieldNumber)
ownerSM
- The owning State Manager.ownerFieldNumber
- The field number in the owner that the embedded/serialised object is stored aspublic void removeEmbeddedOwner(javax.jdo.spi.StateManager ownerSM, int ownerFieldNumber)
ownerSM
- The owner to removeownerFieldNumber
- The field in the owner where this object is storedpublic java.lang.Object newSCOInstance(int fieldNumber, java.lang.Object value, boolean forUpdate)
newSCOInstance
in interface StateManager
fieldNumber
- The field numbervalue
- The valueforUpdate
- Whether this SCO needs updating in the datastore
public java.lang.Object replaceSCOField(int fieldNumber, java.lang.Object value)
replaceSCOField
in interface StateManager
fieldNumber
- Number of fieldvalue
- New value of the field
public java.lang.Object newSCOEmptyInstance(int fieldNumber)
newSCOEmptyInstance
in interface StateManager
fieldNumber
- Number of field
public java.lang.Object getVersion(javax.jdo.spi.PersistenceCapable pc)
getVersion
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable
instance
public void setTransactionalVersion(java.lang.Object version)
setTransactionalVersion
in interface StateManager
version
- The versionpublic java.lang.Object getTransactionalVersion(javax.jdo.spi.PersistenceCapable pc)
getTransactionalVersion
in interface StateManager
pc
- the calling PersistenceCapable
instance
public void setVersion(java.lang.Object version)
setVersion
in interface StateManager
version
- The versionpublic int getHighestFieldNumber()
getHighestFieldNumber
in interface StateManager
public LifeCycleState getLifecycleState()
public void runReachability(java.util.Set reachables)
runReachability
in interface StateManager
reachables
- List of StateManagers currently logged as reachablepublic void makePersistent()
makePersistent
in interface StateManager
public boolean isInserting()
isInserting
in interface StateManager
public void changeActivityState(ActivityState activityState)
changeActivityState
in interface StateManager
activityState
- the new statepublic void addInsertionNotifier(javax.jdo.spi.StateManager sm, ActivityState activityState)
sm
- the state manageractivityState
- the ActivityState (unused)public void updateFieldAfterInsert(javax.jdo.spi.PersistenceCapable pc, int fieldNumber)
updateFieldAfterInsert
in interface StateManager
pc
- The PersistenceCapablefieldNumber
- Number of the field.public void makePersistentTransactionalTransient()
makePersistentTransactionalTransient
in interface StateManager
public void makeTransactional()
makeTransactional
in interface StateManager
public void makeNontransactional()
makeNontransactional
in interface StateManager
public void makeTransient(FetchPlanState state)
makeTransient
in interface StateManager
state
- Object containing the state of any fetchplan processingpublic void detach(FetchPlanState state)
detach
in interface StateManager
state
- State for the detachment processpublic java.lang.Object detachCopy(FetchPlanState state)
detachCopy
in interface StateManager
state
- State for the detachment process
public java.lang.Object attachCopy(javax.jdo.spi.PersistenceCapable detachedPC, boolean embedded)
attachCopy
in interface StateManager
detachedPC
- the detached PersistenceCapable instance to be attachedembedded
- Whether the object is stored embedded/serialised in another object
public void deletePersistent()
deletePersistent
in interface StateManager
public void nullifyFields()
nullifyFields
in interface StateManager
public void validate()
validate
in interface StateManager
public void evict()
evict
in interface StateManager
public void refresh()
refresh
in interface StateManager
public void retrieve(boolean fgOnly)
retrieve
in interface StateManager
fgOnly
- Only load the current fetch group fieldspublic void retrieve(javax.jdo.FetchPlan fetchPlan)
retrieve
in interface StateManager
fetchPlan
- the fetch plan to load fieldspublic void postCommit(javax.jdo.Transaction tx)
postCommit
in interface StateManager
tx
- The Transactionpublic void preRollback(javax.jdo.Transaction tx)
preRollback
in interface StateManager
tx
- The Transaction been rolled backpublic void setStoringPC()
public void unsetStoringPC()
public void preSerialize(javax.jdo.spi.PersistenceCapable pc)
preSerialize
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancepublic void flush()
Note that "dirty" in this case is not equated to being in the P_DIRTY state. The P_DIRTY state means that at least one field in the object has been written by the user during the current transaction, whereas for the purposes of this method, a field is "dirty" if it's been written by the user but not yet updated in the data store. The difference is, it's possible for an object's state to be P_DIRTY, yet have no "dirty" fields because flush() has been called at least once during the transaction.
flush
in interface StateManager
public void disconnect()
disconnect
in interface StateManager
public void registerTransactional()
public void retrieveDetachState(StateManagerImpl sm)
sm
- The State Managerpublic void resetDetachState()
resetDetachState
in interface StateManager
public java.lang.Object[] replacingDetachedState(javax.jdo.spi.Detachable pc, java.lang.Object[] currentState)
replacingDetachedState
in interface javax.jdo.spi.StateManager
pc
- The PersistenceCapable beind updatedcurrentState
- The current state values
public void dump(java.io.PrintWriter out)
dump
in interface StateManager
out
- PrintWriter to dump to
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |