public abstract class UnitOfWorkValueHolder extends DatabaseValueHolder
isCoordinatedWithProperty
Modifier and Type | Field and Description |
---|---|
protected ValueHolder |
backupValueHolder
The value holder stored in the backup copy, should not be transient.
|
protected DatabaseMapping |
mapping
The mapping for the attribute.
|
protected java.lang.Object |
relationshipSourceObject
This attribute is used specifically for relationship support.
|
protected UnitOfWorkImpl |
remoteUnitOfWork
These cannot be transient because they are required for a remote unit of work.
|
protected java.lang.String |
sourceAttributeName |
protected java.lang.Object |
sourceObject |
protected ValueHolderInterface |
wrappedValueHolder
The value holder in the original object.
|
protected java.rmi.server.ObjID |
wrappedValueHolderRemoteID |
isCoordinatedWithProperty, isInstantiated, row, session, value
shouldToStringInstantiate
Modifier | Constructor and Description |
---|---|
protected |
UnitOfWorkValueHolder(ValueHolderInterface attributeValue,
java.lang.Object clone,
DatabaseMapping mapping,
UnitOfWorkImpl unitOfWork) |
Modifier and Type | Method and Description |
---|---|
protected abstract java.lang.Object |
buildBackupCloneFor(java.lang.Object cloneAttributeValue)
Backup the clone attribute value.
|
abstract java.lang.Object |
buildCloneFor(java.lang.Object originalAttributeValue)
Clone the original attribute value.
|
protected ValueHolder |
getBackupValueHolder() |
protected DatabaseMapping |
getMapping() |
protected java.lang.Object |
getRelationshipSourceObject() |
protected UnitOfWorkImpl |
getRemoteUnitOfWork() |
protected java.lang.String |
getSourceAttributeName() |
protected java.lang.Object |
getSourceObject() |
protected UnitOfWorkImpl |
getUnitOfWork() |
protected java.lang.Object |
getValueFromServerObject()
This is used for a remote unit of work.
|
ValueHolderInterface |
getWrappedValueHolder() |
java.rmi.server.ObjID |
getWrappedValueHolderRemoteID()
returns wrapped ValueHolder ObjID if available
|
protected java.lang.Object |
instantiate()
Get the value from the wrapped value holder, instantiating it
if necessary, and clone it.
|
java.lang.Object |
instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder unitOfWorkValueHolder)
Triggers UnitOfWork valueholders directly without triggering the wrapped
valueholder (this).
|
protected java.lang.Object |
instantiateImpl()
a.k.a getValueFromWrappedValueholder.
|
boolean |
isEasilyInstantiated()
INTERNAL:
Answers if this valueholder is easy to instantiate.
|
boolean |
isPessimisticLockingValueHolder()
INTERNAL:
Answers if this valueholder is a pessimistic locking one.
|
boolean |
isSerializedRemoteUnitOfWorkValueHolder()
Used to determine if this is a remote uow value holder that was serialized to the server.
|
void |
releaseWrappedValueHolder()
Releases a wrapped valueholder privately owned by a particular unit of work.
|
protected void |
resetFields()
Reset all the fields that are not needed after instantiation.
|
void |
setBackupValueHolder(ValueHolder backupValueHolder) |
protected void |
setMapping(DatabaseMapping mapping) |
protected void |
setRelationshipSourceObject(java.lang.Object relationshipSourceObject) |
protected void |
setRemoteUnitOfWork(UnitOfWorkImpl remoteUnitOfWork) |
protected void |
setSourceAttributeName(java.lang.String name) |
protected void |
setSourceObject(java.lang.Object sourceObject) |
protected void |
setWrappedValueHolder(DatabaseValueHolder valueHolder) |
clone, getRow, getSession, getValue, isCoordinatedWithProperty, isInstantiated, isNewlyWeavedValueHolder, isTransactionalValueHolder, privilegedSetValue, setInstantiated, setIsCoordinatedWithProperty, setIsNewlyWeavedValueHolder, setRow, setSession, setUninstantiated, setValue, toString
protected transient ValueHolderInterface wrappedValueHolder
protected transient DatabaseMapping mapping
protected ValueHolder backupValueHolder
protected UnitOfWorkImpl remoteUnitOfWork
protected java.lang.Object sourceObject
protected transient java.lang.Object relationshipSourceObject
protected java.lang.String sourceAttributeName
protected java.rmi.server.ObjID wrappedValueHolderRemoteID
protected UnitOfWorkValueHolder(ValueHolderInterface attributeValue, java.lang.Object clone, DatabaseMapping mapping, UnitOfWorkImpl unitOfWork)
protected abstract java.lang.Object buildBackupCloneFor(java.lang.Object cloneAttributeValue)
public abstract java.lang.Object buildCloneFor(java.lang.Object originalAttributeValue)
protected ValueHolder getBackupValueHolder()
protected DatabaseMapping getMapping()
protected UnitOfWorkImpl getRemoteUnitOfWork()
protected java.lang.String getSourceAttributeName()
protected java.lang.Object getSourceObject()
protected java.lang.Object getRelationshipSourceObject()
protected UnitOfWorkImpl getUnitOfWork()
protected java.lang.Object getValueFromServerObject()
protected java.lang.Object instantiateImpl()
public boolean isEasilyInstantiated()
isEasilyInstantiated
in class DatabaseValueHolder
public boolean isPessimisticLockingValueHolder()
isPessimisticLockingValueHolder
in class DatabaseValueHolder
public ValueHolderInterface getWrappedValueHolder()
public java.rmi.server.ObjID getWrappedValueHolderRemoteID()
public boolean isSerializedRemoteUnitOfWorkValueHolder()
isSerializedRemoteUnitOfWorkValueHolder
in class DatabaseValueHolder
protected java.lang.Object instantiate()
instantiate
in class DatabaseValueHolder
public java.lang.Object instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder unitOfWorkValueHolder)
When in transaction and/or for pessimistic locking the UnitOfWorkValueHolder needs to be triggered directly without triggering the wrapped valueholder. However only the wrapped valueholder knows how to trigger the indirection, i.e. it may be a batchValueHolder, and it stores all the info like the row and the query.
instantiateForUnitOfWorkValueHolder
in class DatabaseValueHolder
public void releaseWrappedValueHolder()
When unit of work clones are built directly from rows no object in the shared cache points to this valueholder, so it can store the unit of work as its session. However once that UnitOfWork commits and the valueholder is merged into the shared cache, the session needs to be reset to the root session, ie. the server session.
releaseWrappedValueHolder
in class DatabaseValueHolder
protected void resetFields()
resetFields
in class DatabaseValueHolder
public void setBackupValueHolder(ValueHolder backupValueHolder)
protected void setMapping(DatabaseMapping mapping)
protected void setRemoteUnitOfWork(UnitOfWorkImpl remoteUnitOfWork)
protected void setSourceAttributeName(java.lang.String name)
protected void setSourceObject(java.lang.Object sourceObject)
protected void setRelationshipSourceObject(java.lang.Object relationshipSourceObject)
protected void setWrappedValueHolder(DatabaseValueHolder valueHolder)