Top Description Fields Constructors Methods
org.eclipse.persistence.internal.indirection

public Class ProtectedValueHolder<T>

extends DatabaseValueHolder<T>
implements WrappingValueHolder<T>
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.internal.indirection.WrappingValueHolder
Imports
org.eclipse.persistence.exceptions.DatabaseException, .ValidationException, org.eclipse.persistence.indirection.ValueHolderInterface, org.eclipse.persistence.internal.sessions.AbstractSession, org.eclipse.persistence.mappings.DatabaseMapping

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.

Author
Gordon Yorke
Since
EclipseLink 2.2

Field Summary

Modifier and TypeField and Description
protected transient DatabaseMapping
protected transient ValueHolderInterface<T>
Inherited from org.eclipse.persistence.internal.indirection.DatabaseValueHolder:
isCoordinatedWithPropertyisInstantiatedrowsessionvalue

Constructor Summary

AccessConstructor and Description
public
ProtectedValueHolder(ValueHolderInterface<T> attributeValue, DatabaseMapping mapping, AbstractSession cloningSession)

Method Summary

Modifier and TypeMethod and Description
public ValueHolderInterface<T>
protected T
public T
instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder<T> unitOfWorkValueHolder)

Implements abstract org.eclipse.persistence.internal.indirection.DatabaseValueHolder.instantiateForUnitOfWorkValueHolder.

Triggers UnitOfWork valueholders directly without triggering the wrapped valueholder (this).
public boolean
Inherited from org.eclipse.persistence.internal.indirection.DatabaseValueHolder:
clonegetRowgetSessiongetValuegetValueisCoordinatedWithPropertyisEasilyInstantiatedisInstantiatedisNewlyWeavedValueHolderisSerializedRemoteUnitOfWorkValueHolderisTransactionalValueHolderpostInstantiateprivilegedSetValuereleaseWrappedValueHolderresetFieldssetInstantiatedsetIsCoordinatedWithPropertysetIsNewlyWeavedValueHoldersetRowsetSessionsetUninstantiatedsetValueshouldAllowInstantiationDeferraltoString

Field Detail

mappingback to summary
protected transient DatabaseMapping mapping
wrappedValueHolderback to summary
protected transient ValueHolderInterface<T> wrappedValueHolder

Constructor Detail

ProtectedValueHolderback to summary
public ProtectedValueHolder(ValueHolderInterface<T> attributeValue, DatabaseMapping mapping, AbstractSession cloningSession)

Method Detail

getWrappedValueHolderback to summary
public ValueHolderInterface<T> getWrappedValueHolder()

Overrides org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getWrappedValueHolder.

Implements org.eclipse.persistence.internal.indirection.WrappingValueHolder.getWrappedValueHolder.

Doc from org.eclipse.persistence.internal.indirection.WrappingValueHolder.getWrappedValueHolder.

Returns the valueholder that is wrapped by this ValueHolder

Annotations
@Override
instantiateback to summary
protected T instantiate() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.indirection.DatabaseValueHolder.instantiate.

Doc from org.eclipse.persistence.internal.indirection.DatabaseValueHolder.instantiate.

Instantiate the object.

Annotations
@Override
instantiateForUnitOfWorkValueHolderback to summary
public T instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder<T> unitOfWorkValueHolder)

Implements abstract org.eclipse.persistence.internal.indirection.DatabaseValueHolder.instantiateForUnitOfWorkValueHolder.

Doc from org.eclipse.persistence.internal.indirection.DatabaseValueHolder.instantiateForUnitOfWorkValueHolder.

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

Annotations
@Override
isPessimisticLockingValueHolderback to summary
public boolean isPessimisticLockingValueHolder()

Implements abstract org.eclipse.persistence.internal.indirection.DatabaseValueHolder.isPessimisticLockingValueHolder.

Doc from org.eclipse.persistence.internal.indirection.DatabaseValueHolder.isPessimisticLockingValueHolder.

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

Annotations
@Override