Class ChangeTrackingIndirectCollection<T>

java.lang.Object
cz.cvut.kbss.jopa.proxy.change.ChangeTrackingIndirectCollection<T>
Type Parameters:
T - Type of the wrapped object
All Implemented Interfaces:
IndirectWrapper<T>
Direct Known Subclasses:
ChangeTrackingIndirectList, ChangeTrackingIndirectMap, ChangeTrackingIndirectSet

public abstract class ChangeTrackingIndirectCollection<T> extends Object implements IndirectWrapper<T>
Wraps a collection so that calls to modifying operations are intercepted and reported to the persistence context (if necessary).
  • Field Details

    • owner

      protected final transient Object owner
    • field

      protected final transient Field field
    • persistenceContext

      protected final transient UnitOfWork persistenceContext
  • Constructor Details

    • ChangeTrackingIndirectCollection

      protected ChangeTrackingIndirectCollection(Object owner, Field f, UnitOfWork persistenceContext)
      Create new indirect collection from the specified data.

      The owner can be null, the persistence context not.

      Parameters:
      owner - Owner of the indirect collection
      f - The field holding this collection
      persistenceContext - Persistence context the owner belongs to
      Throws:
      NullPointerException - If the persistence context is null
  • Method Details

    • persistChange

      protected void persistChange()