public class DetachedStateManager extends Object implements OpenJPAStateManager, Serializable
OpenJPAStateManager
contract to allow for serialization.Modifier and Type | Field and Description |
---|---|
protected double |
dblval |
protected int |
field |
protected long |
longval |
protected Object |
objval |
SET_ATTACH, SET_REMOTE, SET_USER
Constructor and Description |
---|
DetachedStateManager(PersistenceCapable pc,
OpenJPAStateManager sm,
BitSet load,
boolean access,
boolean multithreaded)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accessingField(int idx)
Field access callback.
|
boolean |
assignObjectId(boolean flush)
Ask the store manager to assign a permanent oid to this new instance.
|
Object |
attach(AttachManager manager,
Object toAttach,
ClassMetaData meta,
PersistenceCapable into,
OpenJPAStateManager owner,
ValueMetaData ownerMeta,
boolean explicit)
Attach.
|
protected Collection |
attachCollection(AttachManager manager,
Collection orig,
OpenJPAStateManager sm,
FieldMetaData fmd)
Return a new collection with the attached contents of the given one.
|
protected boolean |
attachField(AttachManager manager,
Object toAttach,
StateManagerImpl sm,
FieldMetaData fmd,
boolean nullLoaded)
Attach the given field into the given instance.
|
protected Map |
attachMap(AttachManager manager,
Map orig,
OpenJPAStateManager sm,
FieldMetaData fmd)
Make sure all the values in the given map are attached.
|
boolean |
beforeRefresh(boolean all)
Prepare the instance for refresh
|
void |
clear()
Clear any held state.
|
void |
dirty(int field)
Mark the given field as dirty.
|
void |
dirty(String field)
Make named field dirty.
|
Object |
fetch(int field)
Return the externalized value of the field with the given index as an
object.
|
boolean |
fetchBoolean(int field)
Return the external value of the given field.
|
boolean |
fetchBooleanField(int field)
Return the value of the given field.
|
byte |
fetchByte(int field)
Return the external value of the given field.
|
byte |
fetchByteField(int field)
Return the value of the given field.
|
char |
fetchChar(int field)
Return the external value of the given field.
|
char |
fetchCharField(int field)
Return the value of the given field.
|
double |
fetchDouble(int field)
Return the external value of the given field.
|
double |
fetchDoubleField(int field)
Return the value of the given field.
|
Object |
fetchField(int field,
boolean transitions)
Return the value of the field with the given index as an object.
|
float |
fetchFloat(int field)
Return the external value of the given field.
|
float |
fetchFloatField(int field)
Return the value of the given field.
|
Object |
fetchInitialField(int field)
Return the value of the field at the specified index as of the
beginning of the transaction.
|
int |
fetchInt(int field)
Return the external value of the given field.
|
int |
fetchIntField(int field)
Return the value of the given field.
|
long |
fetchLong(int field)
Return the external value of the given field.
|
long |
fetchLongField(int field)
Return the value of the given field.
|
Object |
fetchObject(int field)
Return the external value of the given field.
|
Object |
fetchObjectField(int field)
Return the value of the given field.
|
Object |
fetchObjectId()
Return the object id, assigning it if necessary.
|
short |
fetchShort(int field)
Return the external value of the given field.
|
short |
fetchShortField(int field)
Return the value of the given field.
|
String |
fetchString(int field)
Return the external value of the given field.
|
String |
fetchStringField(int field)
Return the value of the given field.
|
StoreContext |
getContext()
Return the managing context.
|
protected Object |
getDetachedObjectId(AttachManager manager,
Object toAttach)
Return the identity of the given detached instance.
|
BitSet |
getDirty()
Return a read-only mask of the indexes of all dirty fields.
|
BitSet |
getFlushed()
Return a read-only mask of the indexes of all fields that have been
flushed since they were last changed.
|
Object |
getGenericContext()
Persistence context.
|
Object |
getId()
Return the identifier for this state manager.
|
Object |
getImplData()
An object that concrete back ends can associate with each instance.
|
Object |
getImplData(int field)
Field-level impl data.
|
Object |
getIntermediate(int field)
Use intermediate field data to store intermediate information that
might be available before the field is fully loaded.
|
BitSet |
getLoaded()
Return a read-only mask of the indexes of all loaded fields.
|
Object |
getLock()
The lock object set for this instance.
|
Object |
getManagedInstance()
Return the managed instance.
|
ClassMetaData |
getMetaData()
Get the metadata for this instance.
|
Object |
getObjectId()
Return the instance's object id.
|
OpenJPAStateManager |
getOwner()
Return the owning state if this is an embedded instance.
|
int |
getOwnerIndex()
Return the owning value's field index
|
Object |
getPCPrimaryKey(Object oid,
int field)
Return the persistence-capable primary key object by extracting the
identity value of the related instance stored in the given field from
the given object id.
|
PCState |
getPCState()
Return the state that this object is in.
|
PersistenceCapable |
getPersistenceCapable()
Return the
PersistenceCapable instance that provides access to
the instance managed by this state manager. |
protected Object |
getReference(AttachManager manager,
Object toAttach,
OpenJPAStateManager sm,
ValueMetaData vmd)
Return a managed, possibly hollow reference for the given detached
object.
|
BitSet |
getUnloaded(FetchConfiguration fetch)
Return a mutable mask of the unloaded fields that need loading based
on the given fetch configuration.
|
boolean |
getUseDSFForUnproxy()
Should DetachedStateField be used by Proxies to determine when to remove
$proxy wrappers during serialization.
|
Object |
getVersion()
Return the current version indicator for this instance.
|
protected static boolean |
ignoreLoaded(FieldMetaData fmd)
Ignore if the field is not dirty but loaded
|
void |
initialize(Class forType,
PCState state)
Initialize the state manager with a new instance of the given
persistence capable type and the proper lifecycle state.
|
boolean |
isDefaultValue(int field)
Return true if the given field has a default value.
|
boolean |
isDelayed(int field)
Some field types (collection proxies) support delayed loading.
|
boolean |
isDeleted()
Whether the instance is deleted in this transaction.
|
boolean |
isDetached()
Whether the instance is detached (i.e. this manager is a detached
state manager)
|
boolean |
isDirty()
Whether the instance has been modified in this transaction.
|
boolean |
isEmbedded()
Return true if this instance has an owner, meaning it is an embedded
value.
|
boolean |
isFlushed()
Return whether this object has been flushed to the datastore in this
transaction.
|
boolean |
isFlushedDirty()
Return whether this object has been flushed, then dirtied again.
|
boolean |
isImplDataCacheable()
Whether the instance-level impl data can be shared among instances
in different contexts if L2 caching is enabled.
|
boolean |
isImplDataCacheable(int field)
Whether the field's impl data is loaded and can be shared among
instances in different contexts if L2 caching is enabled.
|
boolean |
isNew()
Whether the instance is newly-persisted in this transaction.
|
boolean |
isPersistent()
Whether the instance is persistent.
|
boolean |
isProvisional()
Return whether this object is provisionally persistent.
|
boolean |
isTransactional()
Whether the instance is transactional.
|
boolean |
isVersionCheckRequired()
Returns true if this state needs to issue a version check at flush time.
|
boolean |
isVersionUpdateRequired()
Returns true if this state needs to issue a version update, possibly
as a result of being locked.
|
void |
load(FetchConfiguration fetch)
Load fetch group fields.
|
void |
loadDelayedField(int field)
If a field was marked delayed in a previous load operation this method can be
used to load the field.
|
void |
lock() |
Object |
newFieldProxy(int field)
Create a new hollow proxy instance for the given field.
|
Object |
newProxy(int field)
Create a new hollow proxy instance for the given field.
|
protected StateManagerImpl |
persist(AttachManager manager,
PersistenceCapable pc,
ClassMetaData meta,
Object appId,
boolean explicit)
Return a PNew/PNewProvisional managed object for the given detached
instance.
|
void |
providedBooleanField(PersistenceCapable pc,
int idx,
boolean cur)
Provide state callback.
|
void |
providedByteField(PersistenceCapable pc,
int idx,
byte cur)
Provide state callback.
|
void |
providedCharField(PersistenceCapable pc,
int idx,
char cur)
Provide state callback.
|
void |
providedDoubleField(PersistenceCapable pc,
int idx,
double cur)
Provide state callback.
|
void |
providedFloatField(PersistenceCapable pc,
int idx,
float cur)
Provide state callback.
|
void |
providedIntField(PersistenceCapable pc,
int idx,
int cur)
Provide state callback.
|
void |
providedLongField(PersistenceCapable pc,
int idx,
long cur)
Provide state callback.
|
void |
providedObjectField(PersistenceCapable pc,
int idx,
Object cur)
Provide state callback.
|
void |
providedShortField(PersistenceCapable pc,
int idx,
short cur)
Provide state callback.
|
void |
providedStringField(PersistenceCapable pc,
int idx,
String cur)
Provide state callback.
|
protected void |
provideField(Object toAttach,
StateManagerImpl sm,
int field)
Provide the given field into this field manager.
|
void |
proxyDetachedDeserialized(int idx)
Proxy the given detached field after deserialization.
|
void |
removed(int field,
Object removed,
boolean key)
Notification that an element has been removed from the given field.
|
boolean |
replaceBooleanField(PersistenceCapable pc,
int idx)
Replace state callback.
|
byte |
replaceByteField(PersistenceCapable pc,
int idx)
Replace state callback.
|
char |
replaceCharField(PersistenceCapable pc,
int idx)
Replace state callback.
|
double |
replaceDoubleField(PersistenceCapable pc,
int idx)
Replace state callback.
|
float |
replaceFloatField(PersistenceCapable pc,
int idx)
Replace state callback.
|
int |
replaceIntField(PersistenceCapable pc,
int idx)
Replace state callback.
|
long |
replaceLongField(PersistenceCapable pc,
int idx)
Replace state callback.
|
Object |
replaceObjectField(PersistenceCapable pc,
int idx)
Replace state callback.
|
short |
replaceShortField(PersistenceCapable pc,
int idx)
Replace state callback.
|
StateManager |
replaceStateManager(StateManager sm)
Change state manager.
|
String |
replaceStringField(PersistenceCapable pc,
int idx)
Replace state callback.
|
boolean |
serializing()
Callback to prepare instance for serialization.
|
void |
setDelayed(int field,
boolean delay)
Some field types (collection proxies) support delayed loading.
|
Object |
setImplData(int field,
Object data)
Field-level impl data.
|
Object |
setImplData(Object data,
boolean cacheable)
An object that concrete back ends can associate with each instance.
|
void |
setIntermediate(int field,
Object data)
Use intermediate field data to store intermediate information that
might be available before the field is fully loaded.
|
void |
setLock(Object lock)
The lock object set for this instance.
|
void |
setNextVersion(Object version)
Set the next version indicator in the datastore pending a successful
flush.
|
void |
setObjectId(Object oid)
Set the object id for the managed instance.
|
void |
setRemote(int field,
Object value)
Set the given field to the given value.
|
void |
settingBooleanField(PersistenceCapable pc,
int idx,
boolean cur,
boolean next,
int set)
Setting state callback.
|
void |
settingByteField(PersistenceCapable pc,
int idx,
byte cur,
byte next,
int set)
Setting state callback.
|
void |
settingCharField(PersistenceCapable pc,
int idx,
char cur,
char next,
int set)
Setting state callback.
|
void |
settingDoubleField(PersistenceCapable pc,
int idx,
double cur,
double next,
int set)
Setting state callback.
|
void |
settingFloatField(PersistenceCapable pc,
int idx,
float cur,
float next,
int set)
Setting state callback.
|
void |
settingIntField(PersistenceCapable pc,
int idx,
int cur,
int next,
int set)
Setting state callback.
|
void |
settingLongField(PersistenceCapable pc,
int idx,
long cur,
long next,
int set)
Setting state callback.
|
void |
settingObjectField(PersistenceCapable pc,
int idx,
Object cur,
Object next,
int set)
Setting state callback.
|
void |
settingShortField(PersistenceCapable pc,
int idx,
short cur,
short next,
int set)
Setting state callback.
|
void |
settingStringField(PersistenceCapable pc,
int idx,
String cur,
String next,
int set)
Setting state callback.
|
void |
setVersion(Object version)
Set the version indicator for this instance, as loaded from the
data store.
|
void |
store(int field,
Object extVal)
Set the value of the field with the given index as from the external
object value.
|
void |
storeBoolean(int field,
boolean extVal)
Set the given external value back into the given field.
|
void |
storeBooleanField(int field,
boolean curVal)
Set the value of the given field.
|
void |
storeByte(int field,
byte extVal)
Set the given external value back into the given field.
|
void |
storeByteField(int field,
byte curVal)
Set the value of the given field.
|
void |
storeChar(int field,
char extVal)
Set the given external value back into the given field.
|
void |
storeCharField(int field,
char curVal)
Set the value of the given field.
|
void |
storeDouble(int field,
double extVal)
Set the given external value back into the given field.
|
void |
storeDoubleField(int field,
double curVal)
Set the value of the given field.
|
void |
storeField(int field,
Object value)
Set the value of the field with the given index as an object.
|
void |
storeFloat(int field,
float extVal)
Set the given external value back into the given field.
|
void |
storeFloatField(int field,
float curVal)
Set the value of the given field.
|
void |
storeInt(int field,
int extVal)
Set the given external value back into the given field.
|
void |
storeIntField(int field,
int curVal)
Set the value of the given field.
|
void |
storeLong(int field,
long extVal)
Set the given external value back into the given field.
|
void |
storeLongField(int field,
long curVal)
Set the value of the given field.
|
void |
storeObject(int field,
Object extVal)
Set the given external value back into the given field.
|
void |
storeObjectField(int field,
Object curVal)
Set the value of the given field.
|
void |
storeShort(int field,
short extVal)
Set the given external value back into the given field.
|
void |
storeShortField(int field,
short curVal)
Set the value of the given field.
|
void |
storeString(int field,
String extVal)
Set the given external value back into the given field.
|
void |
storeStringField(int field,
String curVal)
Set the value of the given field.
|
void |
unlock() |
boolean |
writeDetached(ObjectOutput out)
Write detached state object and detached state manager to the
given stream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fetchObjectField
storeBooleanField, storeByteField, storeCharField, storeDoubleField, storeFloatField, storeIntField, storeLongField, storeObjectField, storeShortField, storeStringField
fetchBooleanField, fetchByteField, fetchCharField, fetchDoubleField, fetchFloatField, fetchIntField, fetchLongField, fetchShortField, fetchStringField
protected double dblval
protected long longval
protected Object objval
protected int field
public DetachedStateManager(PersistenceCapable pc, OpenJPAStateManager sm, BitSet load, boolean access, boolean multithreaded)
pc
- the managed instancesm
- the instance's state managerload
- the set of detached field indexesaccess
- whether to allow access to unloaded fieldsmultithreaded
- whether the instance will be used concurrently
by multiple threadspublic Object attach(AttachManager manager, Object toAttach, ClassMetaData meta, PersistenceCapable into, OpenJPAStateManager owner, ValueMetaData ownerMeta, boolean explicit)
manager
- manager holding cache of attached instancestoAttach
- detached instancemeta
- metadata for the instance being attachedinto
- instance we're attaching intoowner
- state manager for into
ownerMeta
- field we traversed to find toAttach
explicit
- whether to make new instances explicitly persistentprotected Object getDetachedObjectId(AttachManager manager, Object toAttach)
protected void provideField(Object toAttach, StateManagerImpl sm, int field)
protected static boolean ignoreLoaded(FieldMetaData fmd)
public Object getGenericContext()
StateManager
getGenericContext
in interface StateManager
public Object getPCPrimaryKey(Object oid, int field)
StateManager
getPCPrimaryKey
in interface StateManager
public StateManager replaceStateManager(StateManager sm)
StateManager
replaceStateManager
in interface StateManager
public Object getVersion()
OpenJPAStateManager
getVersion
in interface StateManager
getVersion
in interface OpenJPAStateManager
public void setVersion(Object version)
OpenJPAStateManager
StoreManager
when
loading instance data. On rollback, the version will be rolled back
to this value. Version objects should be serializable and should not
require vendor-specific classes, because they are transferred to
detached objects.setVersion
in interface OpenJPAStateManager
public boolean isDirty()
StateManager
isDirty
in interface StateManager
public boolean isTransactional()
StateManager
isTransactional
in interface StateManager
public boolean isPersistent()
StateManager
isPersistent
in interface StateManager
public boolean isNew()
StateManager
isNew
in interface StateManager
public boolean isDeleted()
StateManager
isDeleted
in interface StateManager
public boolean isDetached()
StateManager
isDetached
in interface StateManager
public boolean isVersionUpdateRequired()
OpenJPAStateManager
isVersionUpdateRequired
in interface OpenJPAStateManager
public boolean isVersionCheckRequired()
OpenJPAStateManager
isVersionCheckRequired
in interface OpenJPAStateManager
public void dirty(String field)
StateManager
dirty
in interface StateManager
public Object fetchObjectId()
StateManager
fetchObjectId
in interface StateManager
public void accessingField(int idx)
StateManager
accessingField
in interface StateManager
public boolean serializing()
StateManager
serializing
in interface StateManager
public boolean writeDetached(ObjectOutput out) throws IOException
StateManager
writeDetached
in interface StateManager
IOException
public void proxyDetachedDeserialized(int idx)
StateManager
proxyDetachedDeserialized
in interface StateManager
public void settingBooleanField(PersistenceCapable pc, int idx, boolean cur, boolean next, int set)
StateManager
settingBooleanField
in interface StateManager
public void settingCharField(PersistenceCapable pc, int idx, char cur, char next, int set)
StateManager
settingCharField
in interface StateManager
public void settingByteField(PersistenceCapable pc, int idx, byte cur, byte next, int set)
StateManager
settingByteField
in interface StateManager
public void settingShortField(PersistenceCapable pc, int idx, short cur, short next, int set)
StateManager
settingShortField
in interface StateManager
public void settingIntField(PersistenceCapable pc, int idx, int cur, int next, int set)
StateManager
settingIntField
in interface StateManager
public void settingLongField(PersistenceCapable pc, int idx, long cur, long next, int set)
StateManager
settingLongField
in interface StateManager
public void settingFloatField(PersistenceCapable pc, int idx, float cur, float next, int set)
StateManager
settingFloatField
in interface StateManager
public void settingDoubleField(PersistenceCapable pc, int idx, double cur, double next, int set)
StateManager
settingDoubleField
in interface StateManager
public void settingStringField(PersistenceCapable pc, int idx, String cur, String next, int set)
StateManager
settingStringField
in interface StateManager
public void settingObjectField(PersistenceCapable pc, int idx, Object cur, Object next, int set)
StateManager
settingObjectField
in interface StateManager
public void providedBooleanField(PersistenceCapable pc, int idx, boolean cur)
StateManager
providedBooleanField
in interface StateManager
public void providedCharField(PersistenceCapable pc, int idx, char cur)
StateManager
providedCharField
in interface StateManager
public void providedByteField(PersistenceCapable pc, int idx, byte cur)
StateManager
providedByteField
in interface StateManager
public void providedShortField(PersistenceCapable pc, int idx, short cur)
StateManager
providedShortField
in interface StateManager
public void providedIntField(PersistenceCapable pc, int idx, int cur)
StateManager
providedIntField
in interface StateManager
public void providedLongField(PersistenceCapable pc, int idx, long cur)
StateManager
providedLongField
in interface StateManager
public void providedFloatField(PersistenceCapable pc, int idx, float cur)
StateManager
providedFloatField
in interface StateManager
public void providedDoubleField(PersistenceCapable pc, int idx, double cur)
StateManager
providedDoubleField
in interface StateManager
public void providedStringField(PersistenceCapable pc, int idx, String cur)
StateManager
providedStringField
in interface StateManager
public void providedObjectField(PersistenceCapable pc, int idx, Object cur)
StateManager
providedObjectField
in interface StateManager
public boolean replaceBooleanField(PersistenceCapable pc, int idx)
StateManager
replaceBooleanField
in interface StateManager
public char replaceCharField(PersistenceCapable pc, int idx)
StateManager
replaceCharField
in interface StateManager
public byte replaceByteField(PersistenceCapable pc, int idx)
StateManager
replaceByteField
in interface StateManager
public short replaceShortField(PersistenceCapable pc, int idx)
StateManager
replaceShortField
in interface StateManager
public int replaceIntField(PersistenceCapable pc, int idx)
StateManager
replaceIntField
in interface StateManager
public long replaceLongField(PersistenceCapable pc, int idx)
StateManager
replaceLongField
in interface StateManager
public float replaceFloatField(PersistenceCapable pc, int idx)
StateManager
replaceFloatField
in interface StateManager
public double replaceDoubleField(PersistenceCapable pc, int idx)
StateManager
replaceDoubleField
in interface StateManager
public String replaceStringField(PersistenceCapable pc, int idx)
StateManager
replaceStringField
in interface StateManager
public Object replaceObjectField(PersistenceCapable pc, int idx)
StateManager
replaceObjectField
in interface StateManager
public void initialize(Class forType, PCState state)
OpenJPAStateManager
initialize
in interface OpenJPAStateManager
forType
- the type for which to create a new instancestate
- the initial state to which to set the instancepublic void load(FetchConfiguration fetch)
OpenJPAStateManager
load
in interface OpenJPAStateManager
public Object getManagedInstance()
OpenJPAStateManager
getManagedInstance
in interface OpenJPAStateManager
public PersistenceCapable getPersistenceCapable()
OpenJPAStateManager
PersistenceCapable
instance that provides access to
the instance managed by this state manager. May be a proxy around
the actual managed instance.getPersistenceCapable
in interface OpenJPAStateManager
public ClassMetaData getMetaData()
OpenJPAStateManager
getMetaData
in interface OpenJPAStateManager
public OpenJPAStateManager getOwner()
OpenJPAStateManager
getOwner
in interface OpenJPAStateManager
public int getOwnerIndex()
OpenJPAStateManager
getOwnerIndex
in interface OpenJPAStateManager
public boolean isEmbedded()
OpenJPAStateManager
isEmbedded
in interface OpenJPAStateManager
public boolean isFlushed()
OpenJPAStateManager
isFlushed
in interface OpenJPAStateManager
public boolean isFlushedDirty()
OpenJPAStateManager
isFlushedDirty
in interface OpenJPAStateManager
public boolean isProvisional()
OpenJPAStateManager
isProvisional
in interface OpenJPAStateManager
public BitSet getLoaded()
OpenJPAStateManager
getLoaded
in interface OpenJPAStateManager
public BitSet getDirty()
OpenJPAStateManager
getDirty
in interface OpenJPAStateManager
public boolean getUseDSFForUnproxy()
public BitSet getFlushed()
OpenJPAStateManager
getFlushed
in interface OpenJPAStateManager
public BitSet getUnloaded(FetchConfiguration fetch)
OpenJPAStateManager
getUnloaded
in interface OpenJPAStateManager
public Object newProxy(int field)
OpenJPAStateManager
Proxy
. In all other cases,
this method delegates to the system
ProxyManager
with the correct field information. The returned proxy's owner is
unset so that modifications to the proxy will not be tracked while its
state is initialized. Calling OpenJPAStateManager.storeField(int, java.lang.Object)
or OpenJPAStateManager.store(int, java.lang.Object)
will set the proxy's owner automatically.newProxy
in interface OpenJPAStateManager
public Object newFieldProxy(int field)
OpenJPAStateManager
OpenJPAStateManager.newProxy(int)
in that it returns a proxy for the
field's declared type, not its externalized type.newFieldProxy
in interface OpenJPAStateManager
OpenJPAStateManager.newProxy(int)
public boolean isDefaultValue(int field)
OpenJPAStateManager
isDefaultValue
in interface OpenJPAStateManager
public StoreContext getContext()
OpenJPAStateManager
getContext
in interface OpenJPAStateManager
public PCState getPCState()
OpenJPAStateManager
getPCState
in interface OpenJPAStateManager
public Object getObjectId()
OpenJPAStateManager
getObjectId
in interface OpenJPAStateManager
public void setObjectId(Object oid)
OpenJPAStateManager
storeXXXField
methods will automatically change the oid.setObjectId
in interface OpenJPAStateManager
public boolean assignObjectId(boolean flush)
OpenJPAStateManager
assignObjectId
in interface OpenJPAStateManager
flush
- if true, flush if necessary to get a permanent oid; if
false, the oid may be left unassignedpublic Object getId()
OpenJPAStateManager
OpenJPAStateManager.getObjectId()
.getId
in interface OpenJPAStateManager
public Object getLock()
OpenJPAStateManager
getLock
in interface OpenJPAStateManager
public void setLock(Object lock)
OpenJPAStateManager
setLock
in interface OpenJPAStateManager
public void setNextVersion(Object version)
OpenJPAStateManager
StoreManager
uses this method during flush.setNextVersion
in interface OpenJPAStateManager
public Object getImplData()
OpenJPAStateManager
getImplData
in interface OpenJPAStateManager
public Object setImplData(Object data, boolean cacheable)
OpenJPAStateManager
setImplData
in interface OpenJPAStateManager
cacheable
- whether the impl data can be shared among instances
in different contexts if L2 caching is enabledpublic boolean isImplDataCacheable()
OpenJPAStateManager
isImplDataCacheable
in interface OpenJPAStateManager
public Object getImplData(int field)
OpenJPAStateManager
getImplData
in interface OpenJPAStateManager
public Object setImplData(int field, Object data)
OpenJPAStateManager
FieldMetaData.usesImplData()
.setImplData
in interface OpenJPAStateManager
public boolean isImplDataCacheable(int field)
OpenJPAStateManager
isImplDataCacheable
in interface OpenJPAStateManager
public Object getIntermediate(int field)
OpenJPAStateManager
getIntermediate
in interface OpenJPAStateManager
public void setIntermediate(int field, Object data)
OpenJPAStateManager
setIntermediate
in interface OpenJPAStateManager
public void removed(int field, Object removed, boolean key)
OpenJPAStateManager
removed
in interface OpenJPAStateManager
public boolean beforeRefresh(boolean all)
OpenJPAStateManager
beforeRefresh
in interface OpenJPAStateManager
all
- true if this instance is one of a collection of
objects being refreshedBroker.refresh(java.lang.Object, org.apache.openjpa.kernel.OpCallbacks)
public void dirty(int field)
OpenJPAStateManager
dirty
in interface OpenJPAStateManager
public void storeBoolean(int field, boolean extVal)
OpenJPAStateManager
storeBoolean
in interface OpenJPAStateManager
public void storeByte(int field, byte extVal)
OpenJPAStateManager
storeByte
in interface OpenJPAStateManager
public void storeChar(int field, char extVal)
OpenJPAStateManager
storeChar
in interface OpenJPAStateManager
public void storeInt(int field, int extVal)
OpenJPAStateManager
storeInt
in interface OpenJPAStateManager
public void storeShort(int field, short extVal)
OpenJPAStateManager
storeShort
in interface OpenJPAStateManager
public void storeLong(int field, long extVal)
OpenJPAStateManager
storeLong
in interface OpenJPAStateManager
public void storeFloat(int field, float extVal)
OpenJPAStateManager
storeFloat
in interface OpenJPAStateManager
public void storeDouble(int field, double extVal)
OpenJPAStateManager
storeDouble
in interface OpenJPAStateManager
public void storeString(int field, String extVal)
OpenJPAStateManager
storeString
in interface OpenJPAStateManager
public void storeObject(int field, Object extVal)
OpenJPAStateManager
storeObject
in interface OpenJPAStateManager
public void store(int field, Object extVal)
OpenJPAStateManager
OpenJPAStateManager.storeField(int, java.lang.Object)
.store
in interface OpenJPAStateManager
public void storeField(int field, Object value)
OpenJPAStateManager
storeField
in interface OpenJPAStateManager
public boolean fetchBoolean(int field)
OpenJPAStateManager
fetchBoolean
in interface OpenJPAStateManager
public byte fetchByte(int field)
OpenJPAStateManager
fetchByte
in interface OpenJPAStateManager
public char fetchChar(int field)
OpenJPAStateManager
fetchChar
in interface OpenJPAStateManager
public short fetchShort(int field)
OpenJPAStateManager
fetchShort
in interface OpenJPAStateManager
public int fetchInt(int field)
OpenJPAStateManager
fetchInt
in interface OpenJPAStateManager
public long fetchLong(int field)
OpenJPAStateManager
fetchLong
in interface OpenJPAStateManager
public float fetchFloat(int field)
OpenJPAStateManager
fetchFloat
in interface OpenJPAStateManager
public double fetchDouble(int field)
OpenJPAStateManager
fetchDouble
in interface OpenJPAStateManager
public String fetchString(int field)
OpenJPAStateManager
fetchString
in interface OpenJPAStateManager
public Object fetchObject(int field)
OpenJPAStateManager
fetchObject
in interface OpenJPAStateManager
public Object fetch(int field)
OpenJPAStateManager
OpenJPAStateManager.fetchField(int, boolean)
.fetch
in interface OpenJPAStateManager
public Object fetchField(int field, boolean transitions)
OpenJPAStateManager
fetchField
in interface OpenJPAStateManager
transitions
- if true, this method will cause state transitions
to occur as if the field were accessed normallypublic Object fetchInitialField(int field)
OpenJPAStateManager
fetchInitialField
in interface OpenJPAStateManager
public void setRemote(int field, Object value)
OpenJPAStateManager
setRemote
in interface OpenJPAStateManager
public void lock()
public void unlock()
public boolean isDelayed(int field)
OpenJPAStateManager
isDelayed
in interface OpenJPAStateManager
public void setDelayed(int field, boolean delay)
OpenJPAStateManager
setDelayed
in interface OpenJPAStateManager
public void loadDelayedField(int field)
OpenJPAStateManager
loadDelayedField
in interface OpenJPAStateManager
protected StateManagerImpl persist(AttachManager manager, PersistenceCapable pc, ClassMetaData meta, Object appId, boolean explicit)
protected boolean attachField(AttachManager manager, Object toAttach, StateManagerImpl sm, FieldMetaData fmd, boolean nullLoaded)
toAttach
- the detached persistent instancesm
- state manager for the managed instance we're copying
into; toAttach
also uses this state managerfmd
- metadata on the field we're copyingnullLoaded
- if false, nulls will be considered unloaded and will
not be attachedprotected Object getReference(AttachManager manager, Object toAttach, OpenJPAStateManager sm, ValueMetaData vmd)
protected Collection attachCollection(AttachManager manager, Collection orig, OpenJPAStateManager sm, FieldMetaData fmd)
protected Map attachMap(AttachManager manager, Map orig, OpenJPAStateManager sm, FieldMetaData fmd)
public boolean fetchBooleanField(int field)
FieldSupplier
fetchBooleanField
in interface FieldSupplier
public byte fetchByteField(int field)
FieldSupplier
fetchByteField
in interface FieldSupplier
public char fetchCharField(int field)
FieldSupplier
fetchCharField
in interface FieldSupplier
public double fetchDoubleField(int field)
FieldSupplier
fetchDoubleField
in interface FieldSupplier
public float fetchFloatField(int field)
FieldSupplier
fetchFloatField
in interface FieldSupplier
public int fetchIntField(int field)
FieldSupplier
fetchIntField
in interface FieldSupplier
public long fetchLongField(int field)
FieldSupplier
fetchLongField
in interface FieldSupplier
public Object fetchObjectField(int field)
FieldSupplier
fetchObjectField
in interface FieldSupplier
public short fetchShortField(int field)
FieldSupplier
fetchShortField
in interface FieldSupplier
public String fetchStringField(int field)
FieldSupplier
fetchStringField
in interface FieldSupplier
public void storeBooleanField(int field, boolean curVal)
FieldConsumer
storeBooleanField
in interface FieldConsumer
public void storeByteField(int field, byte curVal)
FieldConsumer
storeByteField
in interface FieldConsumer
public void storeCharField(int field, char curVal)
FieldConsumer
storeCharField
in interface FieldConsumer
public void storeDoubleField(int field, double curVal)
FieldConsumer
storeDoubleField
in interface FieldConsumer
public void storeFloatField(int field, float curVal)
FieldConsumer
storeFloatField
in interface FieldConsumer
public void storeIntField(int field, int curVal)
FieldConsumer
storeIntField
in interface FieldConsumer
public void storeLongField(int field, long curVal)
FieldConsumer
storeLongField
in interface FieldConsumer
public void storeObjectField(int field, Object curVal)
FieldConsumer
storeObjectField
in interface FieldConsumer
public void storeShortField(int field, short curVal)
FieldConsumer
storeShortField
in interface FieldConsumer
public void storeStringField(int field, String curVal)
FieldConsumer
storeStringField
in interface FieldConsumer
public void clear()
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.