|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Extends the StateManager interface for JDO-internal use. Provides additional information about the state of particular fields. Provides a means to give a field's value to an object that can cause that value to be stored.
Field Summary | |
static int |
FLUSHED_COMPLETE
|
static int |
FLUSHED_NONE
|
static int |
FLUSHED_PARTIAL
Return values for flush operations |
Method Summary | |
void |
afterCompletion(boolean abort,
boolean retainValues,
boolean restoreValues)
Transitions lifecycle state in afterCompletion callback |
void |
deletePersistent()
Transitions lifecycle state in to PERSISTENT_DELETED |
void |
evictInstance()
Transitions lifecycle state to HOLLOW |
boolean |
flush(StoreManager srm)
Causes the state manager to send itself to the store manager for insert, update, and so on as per its own state. |
java.lang.Object |
getDependency()
Returns dependency object that contains dependency information specific to this instance of the StateManager |
java.lang.Object |
getExternalObjectId()
Returns external representation of the object id associated with this statemanager. |
java.lang.String |
getFieldName(int fieldNumber)
Returns field name for the field number. |
java.lang.Object |
getInternalObjectId()
Returns internal representation of the object id associated with this statemanager. |
javax.jdo.spi.PersistenceCapable |
getObject()
Provides the object managed by this state manager. |
java.lang.Class |
getPCClass()
Returns PC Class known to this StateManager. |
PersistenceManagerInternal |
getPersistenceManager()
Returns PersistenceManager associated with this StateManager instance |
void |
handleReachability(boolean flag)
Processes relationships for reachability algorithm and define the dependencies |
boolean |
isBeforeImageRequired()
Returns true , if a before image must be created. |
boolean |
isFlushed()
Returns true if the instance has been flushed to the datastore. |
boolean |
isNew()
Tests whether this StateManager represents a instance made persistent object. |
boolean |
isStored()
Returns true if the instance exists in a datastore. |
void |
makeDirty(int fieldNumber)
Mark the associated PersistenceCapable field dirty. |
void |
makeNontransactional()
Transitions lifecycle state in to nontransactional |
void |
makePersistent()
Transitions lifecycle state in to PERSISTENT_NEW |
void |
makeTransactional()
Transitions lifecycle state in to transactional |
void |
makeTransient()
Transitions lifecycle state in to TRANSIENT |
void |
preStore()
Calls preStore on the associated object if necessary. |
void |
provideField(int fieldNumber,
FieldManager fieldManager,
boolean identifying)
Causes the values of the field indicated by the specified field number be given to the FieldManager. |
void |
provideFields(int[] fields,
FieldManager fieldManager,
boolean identifying)
Causes the values of the fields indicated by the specified fields to be given to the FieldManager. |
void |
refreshInstance()
Transitions lifecycle state to P_CLEAN or P_NON_TX |
void |
reload()
Fetch or refresh object from the data store. |
void |
replace(int[] fields,
FieldManager fieldManager)
Transition the lifecycle state as if the instance is retrieved from the datastore, but use the specified field values instead of loading them from the datastore. |
void |
replaceFields(int[] fields,
FieldManager fieldManager)
For replacing field values in a PC with the ones that is provided by the FieldManager. |
void |
replaceSCOFields()
Replaces field values that are regular SCO instances with tracked SCOs. |
void |
retrieve()
Retrieve an instance from the store. |
java.lang.Object |
setDependency(java.lang.Object dependency)
Sets dependency object containing dependency information specific to this instance of the StateManager |
void |
setObjectId(java.lang.Object objectId)
Allows a client to change this state manager's object Id. |
void |
setPCClass(java.lang.Class pcClass)
Allows StateManager to set the actual PC Class if it was not available at the constructor time and create a hollow instnce of that type. |
void |
trackUpdates(int fieldNumber,
SCO sco)
Processes changes to the Tracked SCO instance owned by this StateManager. |
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 |
public static final int FLUSHED_PARTIAL
public static final int FLUSHED_NONE
public static final int FLUSHED_COMPLETE
Method Detail |
public javax.jdo.spi.PersistenceCapable getObject()
public java.lang.Object getInternalObjectId()
public java.lang.Object getExternalObjectId()
public void setObjectId(java.lang.Object objectId)
public boolean flush(StoreManager srm)
srm
- The StoreManager to which the instance should send itself.
public void provideField(int fieldNumber, FieldManager fieldManager, boolean identifying)
fieldNumber
- Indicates which field should be provided to the
fieldManager.fieldManager
- FieldManager to which the field should be given.identifying
- If true, provides values from the before or flushed
image, as determined by this StateManager's state; if false provides
values from the current image.public void provideFields(int[] fields, FieldManager fieldManager, boolean identifying)
fields
- Indicates which fields should be provided to the
fieldManager.fieldManager
- FieldManager to which the field should be given.identifying
- If true, provides values from the before or flushed
image, as determined by this StateManager's state; if false provides
values from the current image.public void replaceFields(int[] fields, FieldManager fieldManager)
fields
- Indicates which fields should be replaced in the PC.fieldManager
- FieldManager from which the field values should
be obtained.public void reload()
public void retrieve()
public void replace(int[] fields, FieldManager fieldManager)
fields
- Indicates which fields should be replaced in the PC.fieldManager
- FieldManager from which the field values should
be obtained.public void afterCompletion(boolean abort, boolean retainValues, boolean restoreValues)
abort
- true if transaction has been rolled backretainValues
- true if values need to be preserved on commit.restoreValues
- true if values need to be restored on rollback.public void makePersistent()
public void makeTransactional()
public void makeNontransactional()
public void makeTransient()
public void deletePersistent()
public void refreshInstance()
public void evictInstance()
public void preStore()
public void replaceSCOFields()
public void handleReachability(boolean flag)
flag
- is true if method is called inside the flush, false otherwisepublic boolean isStored()
public boolean isFlushed()
public java.lang.Object setDependency(java.lang.Object dependency)
dependency
- new dependency objectpublic java.lang.Object getDependency()
public PersistenceManagerInternal getPersistenceManager()
public void makeDirty(int fieldNumber)
The StateManager will make a copy of the field so it can be restored if needed later, and then mark the field as modified in the current transaction.
fieldNumber
- the number of the fieldpublic void trackUpdates(int fieldNumber, SCO sco)
fieldNumber
- the number of the fieldsco
- Tracked SCO instance.public java.lang.String getFieldName(int fieldNumber)
fieldNumber
- the number of the field
public void setPCClass(java.lang.Class pcClass)
pcClass
- the Class type of the instance.public java.lang.Class getPCClass()
public boolean isNew()
true
if this StateManager represents an
instance made persistent in the current transaction.public boolean isBeforeImageRequired()
true
, if a before image must be created. The
decision is based on the current lifecycle state plus other conditions
e.g. transaction type, restore values flag, etc.
true
if a before image must be created.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |