Class ProtectedValueHolder<T>

java.lang.Object
org.eclipse.persistence.internal.indirection.DatabaseValueHolder<T>
org.eclipse.persistence.internal.indirection.ProtectedValueHolder<T>
All Implemented Interfaces:
Serializable, Cloneable, ValueHolderInterface<T>, WeavedAttributeValueHolderInterface<T>, WrappingValueHolder<T>

public class ProtectedValueHolder<T> extends DatabaseValueHolder<T> implements WrappingValueHolder<T>

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
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • instantiate

      protected T instantiate() throws DatabaseException
      Description copied from class: DatabaseValueHolder
      Instantiate the object.
      Specified by:
      instantiate in class DatabaseValueHolder<T>
      Throws:
      DatabaseException
    • instantiateForUnitOfWorkValueHolder

      public T instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder<T> 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 class DatabaseValueHolder<T>
    • 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 class DatabaseValueHolder<T>
    • getWrappedValueHolder

      public ValueHolderInterface<T> getWrappedValueHolder()
      Description copied from interface: WrappingValueHolder
      Returns the valueholder that is wrapped by this ValueHolder
      Specified by:
      getWrappedValueHolder in interface WrappingValueHolder<T>
      Overrides:
      getWrappedValueHolder in class DatabaseValueHolder<T>