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

public Class BackupValueHolder<T>

extends DatabaseValueHolder<T>
Class Inheritance
Imports
org.eclipse.persistence.indirection.*, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession

Used as the backup value holder in the unit of work for transparent indirection. This ensure that a reference to the original value holder is held in case the transparent collection or proxy is replace without first instantiating the original.
Author
James Sutherland
Since
10.1.3

Field Summary

Modifier and TypeField and Description
protected ValueHolderInterface<T>
unitOfWorkValueHolder

Stores the original uow clone's value holder.

Inherited from org.eclipse.persistence.internal.indirection.DatabaseValueHolder:
isCoordinatedWithPropertyisInstantiatedrowsessionvalue

Constructor Summary

AccessConstructor and Description
public
BackupValueHolder(ValueHolderInterface<T> unitOfWorkValueHolder)

Method Summary

Modifier and TypeMethod and Description
public AbstractRecord
public AbstractSession
public ValueHolderInterface<?>
getUnitOfWorkValueHolder()

Return the original uow clone's value holder.

public T
instantiate()

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

If the original value holder was not instantiated, then first instantiate it to obtain the backup value.
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:
clonegetValuegetValuegetWrappedValueHolderisCoordinatedWithPropertyisEasilyInstantiatedisInstantiatedisNewlyWeavedValueHolderisSerializedRemoteUnitOfWorkValueHolderisTransactionalValueHolderpostInstantiateprivilegedSetValuereleaseWrappedValueHolderresetFieldssetInstantiatedsetIsCoordinatedWithPropertysetIsNewlyWeavedValueHoldersetRowsetSessionsetUninstantiatedsetValueshouldAllowInstantiationDeferraltoString

Field Detail

unitOfWorkValueHolderback to summary
protected ValueHolderInterface<T> unitOfWorkValueHolder

Stores the original uow clone's value holder.

Constructor Detail

BackupValueHolderback to summary
public BackupValueHolder(ValueHolderInterface<T> unitOfWorkValueHolder)

Method Detail

getRowback to summary
public AbstractRecord getRow()

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

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

Return the row.

Annotations
@Override
getSessionback to summary
public AbstractSession getSession()

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

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

Return the session.

Annotations
@Override
getUnitOfWorkValueHolderback to summary
public ValueHolderInterface<?> getUnitOfWorkValueHolder()

Return the original uow clone's value holder.

instantiateback to summary
public T instantiate()

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

If the original value holder was not instantiated, then first instantiate it to obtain the backup value.

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