Class ProtectedValueHolder
- java.lang.Object
-
- org.eclipse.persistence.internal.indirection.DatabaseValueHolder
-
- org.eclipse.persistence.internal.indirection.ProtectedValueHolder
-
- All Implemented Interfaces:
Serializable
,Cloneable
,ValueHolderInterface
,WeavedAttributeValueHolderInterface
,WrappingValueHolder
public class ProtectedValueHolder extends DatabaseValueHolder implements WrappingValueHolder
Purpose: provides a value holder type that can be used in Protected instances of Entities. Similar to UnitOfWork Value Holder it wraps the original cache version.
- Since:
- EclipseLink 2.2
- Author:
- Gordon Yorke
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DatabaseMapping
mapping
protected ValueHolderInterface<?>
wrappedValueHolder
-
Fields inherited from class org.eclipse.persistence.internal.indirection.DatabaseValueHolder
isCoordinatedWithProperty, isInstantiated, row, session, value
-
Fields inherited from interface org.eclipse.persistence.indirection.ValueHolderInterface
shouldToStringInstantiate
-
-
Constructor Summary
Constructors Constructor Description ProtectedValueHolder(ValueHolderInterface<?> attributeValue, DatabaseMapping mapping, AbstractSession cloningSession)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueHolderInterface<?>
getWrappedValueHolder()
Returns the valueholder that is wrapped by this ValueHolderprotected Object
instantiate()
Instantiate the object.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.-
Methods inherited from class org.eclipse.persistence.internal.indirection.DatabaseValueHolder
clone, getRow, getSession, getValue, getValue, isCoordinatedWithProperty, isEasilyInstantiated, isInstantiated, isNewlyWeavedValueHolder, isSerializedRemoteUnitOfWorkValueHolder, isTransactionalValueHolder, postInstantiate, privilegedSetValue, releaseWrappedValueHolder, resetFields, setInstantiated, setIsCoordinatedWithProperty, setIsNewlyWeavedValueHolder, setRow, setSession, setUninstantiated, setValue, shouldAllowInstantiationDeferral, toString
-
-
-
-
Field Detail
-
wrappedValueHolder
protected transient ValueHolderInterface<?> wrappedValueHolder
-
mapping
protected transient DatabaseMapping mapping
-
-
Constructor Detail
-
ProtectedValueHolder
public ProtectedValueHolder(ValueHolderInterface<?> attributeValue, DatabaseMapping mapping, AbstractSession cloningSession)
-
-
Method Detail
-
instantiate
protected Object instantiate() throws DatabaseException
Description copied from class:DatabaseValueHolder
Instantiate the object.- Specified by:
instantiate
in classDatabaseValueHolder
- Throws:
DatabaseException
-
instantiateForUnitOfWorkValueHolder
public Object instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder unitOfWorkValueHolder)
Description copied from class:DatabaseValueHolder
Triggers UnitOfWork valueholders directly without triggering the wrapped valueholder (this).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
- Specified by:
instantiateForUnitOfWorkValueHolder
in classDatabaseValueHolder
-
isPessimisticLockingValueHolder
public boolean isPessimisticLockingValueHolder()
Description copied from class:DatabaseValueHolder
Answers if this valueholder is a pessimistic locking one. Such valueholders are special in that they can be triggered multiple times by different UnitsOfWork. Each time a lock query will be issued. Hence even if instantiated it may have to be instantiated again, and once instantiated all fields can not be reset. Note: Implementations of this method are not necessarily thread-safe. They must be used in a synchronizaed manner- Specified by:
isPessimisticLockingValueHolder
in classDatabaseValueHolder
-
getWrappedValueHolder
public ValueHolderInterface<?> getWrappedValueHolder()
Description copied from interface:WrappingValueHolder
Returns the valueholder that is wrapped by this ValueHolder- Specified by:
getWrappedValueHolder
in interfaceWrappingValueHolder
- Overrides:
getWrappedValueHolder
in classDatabaseValueHolder
-
-