public class CacheBasedValueHolder extends DatabaseValueHolder
Purpose: In certain cases the contents of a relationship may be retrievable from a cache. This ValueHolder instance provides the mechanism to store a cached relationship and to load that relationship from a cache. This functionality requires that the persistent identities of the targets can be collected as database type foreign key queries are unavailable.
shouldToStringInstantiate| Constructor and Description |
|---|
CacheBasedValueHolder(java.lang.Object[] pks,
AbstractRecord foreignKeys,
AbstractSession session,
ForeignReferenceMapping mapping) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object[] |
getCachedPKs() |
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.
|
java.lang.Object |
instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder unitOfWorkValueHolder)
Triggers UnitOfWork valueholders directly without triggering the wrapped
valueholder (this).
|
boolean |
isPessimisticLockingValueHolder()
Answers if this valueholder is a pessimistic locking one.
|
void |
setShouldAllowInstantiationDeferral(boolean shouldAllowInstantiationDeferral)
Set if instantiation deferral on modification should be available.
|
boolean |
shouldAllowInstantiationDeferral()
INTERNAL:
Return if add/remove should trigger instantiation or avoid.
|
clone, getRow, getSession, getValue, getWrappedValueHolder, isCoordinatedWithProperty, isEasilyInstantiated, isInstantiated, isNewlyWeavedValueHolder, isSerializedRemoteUnitOfWorkValueHolder, postInstantiate, privilegedSetValue, releaseWrappedValueHolder, setInstantiated, setIsCoordinatedWithProperty, setIsNewlyWeavedValueHolder, setRow, setSession, setUninstantiated, setValue, toStringpublic CacheBasedValueHolder(java.lang.Object[] pks,
AbstractRecord foreignKeys,
AbstractSession session,
ForeignReferenceMapping mapping)
public java.lang.Object[] getCachedPKs()
public java.lang.Object getValue(UnitOfWorkImpl uow)
getValue in class DatabaseValueHolderpublic 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: This method is not thread-safe. It must be used in a synchronized manner
instantiateForUnitOfWorkValueHolder in class DatabaseValueHolderpublic boolean isPessimisticLockingValueHolder()
DatabaseValueHolderisPessimisticLockingValueHolder in class DatabaseValueHolderpublic void setShouldAllowInstantiationDeferral(boolean shouldAllowInstantiationDeferral)
public boolean shouldAllowInstantiationDeferral()
shouldAllowInstantiationDeferral in interface WeavedAttributeValueHolderInterfaceshouldAllowInstantiationDeferral in class DatabaseValueHolderEclipseLink 2.6.3, "build v20160428-59c81c5" API Reference