public interface StateManagerInternal
extends javax.jdo.spi.StateManager
Modifier and Type | Field and Description |
---|---|
static int |
FLUSHED_COMPLETE |
static int |
FLUSHED_NONE |
static int |
FLUSHED_PARTIAL
Return values for flush operations
|
Modifier and Type | Method and Description |
---|---|
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.
|
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
static final int FLUSHED_PARTIAL
static final int FLUSHED_NONE
static final int FLUSHED_COMPLETE
javax.jdo.spi.PersistenceCapable getObject()
java.lang.Object getInternalObjectId()
java.lang.Object getExternalObjectId()
void setObjectId(java.lang.Object objectId)
boolean flush(StoreManager srm)
srm
- The StoreManager to which the instance should send itself.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.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.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.void reload()
void retrieve()
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.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.void makePersistent()
void makeTransactional()
void makeNontransactional()
void makeTransient()
void deletePersistent()
void refreshInstance()
void evictInstance()
void preStore()
void replaceSCOFields()
void handleReachability(boolean flag)
flag
- is true if method is called inside the flush, false otherwiseboolean isStored()
boolean isFlushed()
java.lang.Object setDependency(java.lang.Object dependency)
dependency
- new dependency objectjava.lang.Object getDependency()
PersistenceManagerInternal getPersistenceManager()
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 fieldvoid trackUpdates(int fieldNumber, SCO sco)
fieldNumber
- the number of the fieldsco
- Tracked SCO instance.java.lang.String getFieldName(int fieldNumber)
fieldNumber
- the number of the fieldvoid setPCClass(java.lang.Class pcClass)
pcClass
- the Class type of the instance.java.lang.Class getPCClass()
boolean isNew()
true
if this StateManager represents an
instance made persistent in the current transaction.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.Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.