public abstract class DatabaseValueHolder extends java.lang.Object implements WeavedAttributeValueHolderInterface, java.lang.Cloneable, java.io.Serializable
ValueHolderInterface
,
Serialized FormshouldToStringInstantiate
Constructor and Description |
---|
DatabaseValueHolder() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
PUBLIC:
Copy the value holder (but not its' reference, shallow).
|
AbstractRecord |
getRow()
Return the row.
|
AbstractSession |
getSession()
Return the session.
|
java.lang.Object |
getValue()
Return the object.
|
java.lang.Object |
getValue(UnitOfWorkImpl uow)
Process against the UOW and attempt to load a local copy before going to the shared cache
If null is returned then the calling UOW will instantiate as normal.
|
ValueHolderInterface |
getWrappedValueHolder() |
abstract java.lang.Object |
instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder unitOfWorkValueHolder)
Triggers UnitOfWork valueholders directly without triggering the wrapped
valueholder (this).
|
boolean |
isCoordinatedWithProperty()
This method is used as part of the implementation of WeavedAttributeValueHolderInterface
It is used to check whether a valueholder that has been weaved into a class is coordinated
with the underlying property
|
boolean |
isEasilyInstantiated()
INTERNAL:
Answers if this valueholder is easy to instantiate.
|
boolean |
isInstantiated()
Return a boolean indicating whether the object
has been read from the database or not.
|
boolean |
isNewlyWeavedValueHolder()
This method is used as part of the implementation of WeavedAttributeValueHolderInterface.
|
abstract boolean |
isPessimisticLockingValueHolder()
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 |
postInstantiate()
INTERNAL:
Run any extra code required after the valueholder instantiates
|
void |
privilegedSetValue(java.lang.Object value)
Set the object.
|
void |
releaseWrappedValueHolder(AbstractSession targetSession)
Releases a wrapped valueholder privately owned by a particular unit of work.
|
void |
setInstantiated()
Set the instantiated flag to true.
|
void |
setIsCoordinatedWithProperty(boolean coordinated)
This method is used as part of the implementation of WeavedAttributeValueHolderInterface
It is used internally by EclipseLink to set whether a valueholder that has been weaved into a class is coordinated
with the underlying property
|
void |
setIsNewlyWeavedValueHolder(boolean isNew)
This method is used as part of the implementation of WeavedAttributeValueHolderInterface
A DatabaseValueHolder is set up by EclipseLink and will never be a newly weaved valueholder
As a result, this method is stubbed out.
|
void |
setRow(AbstractRecord row)
Set the row.
|
void |
setSession(AbstractSession session)
Set the session.
|
void |
setUninstantiated()
Set the instantiated flag to false.
|
void |
setValue(java.lang.Object value)
Set the object.
|
boolean |
shouldAllowInstantiationDeferral()
INTERNAL:
Return if add/remove should trigger instantiation or avoid.
|
java.lang.String |
toString() |
public java.lang.Object clone()
ValueHolderInterface
clone
in interface ValueHolderInterface
clone
in class java.lang.Object
public AbstractRecord getRow()
public AbstractSession getSession()
public ValueHolderInterface getWrappedValueHolder()
public java.lang.Object getValue()
getValue
in interface ValueHolderInterface
public java.lang.Object getValue(UnitOfWorkImpl uow)
public abstract 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. Note: Implementations of this method are not necessarily thread-safe. They must be used in a synchronized manner
public boolean isCoordinatedWithProperty()
isCoordinatedWithProperty
in interface WeavedAttributeValueHolderInterface
public boolean isNewlyWeavedValueHolder()
isNewlyWeavedValueHolder
in interface WeavedAttributeValueHolderInterface
public boolean isEasilyInstantiated()
public boolean isInstantiated()
isInstantiated
in interface ValueHolderInterface
public abstract boolean isPessimisticLockingValueHolder()
public boolean isSerializedRemoteUnitOfWorkValueHolder()
public void postInstantiate()
QueryBasedValueHolder
public void privilegedSetValue(java.lang.Object value)
public void releaseWrappedValueHolder(AbstractSession targetSession)
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.
public void setIsCoordinatedWithProperty(boolean coordinated)
setIsCoordinatedWithProperty
in interface WeavedAttributeValueHolderInterface
public void setIsNewlyWeavedValueHolder(boolean isNew)
setIsNewlyWeavedValueHolder
in interface WeavedAttributeValueHolderInterface
public void setInstantiated()
public void setRow(AbstractRecord row)
public void setSession(AbstractSession session)
public void setUninstantiated()
public void setValue(java.lang.Object value)
setValue
in interface ValueHolderInterface
public boolean shouldAllowInstantiationDeferral()
shouldAllowInstantiationDeferral
in interface WeavedAttributeValueHolderInterface
public java.lang.String toString()
toString
in class java.lang.Object
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference