Class CollectionEntry

java.lang.Object
org.hibernate.engine.spi.CollectionEntry
All Implemented Interfaces:
Serializable

public final class CollectionEntry extends Object implements Serializable
We need an entry to tell us all about the current state of a collection with respect to its persistent state
See Also:
  • Constructor Details

  • Method Details

    • preFlush

      public void preFlush(PersistentCollection<?> collection)
    • wasReachedDuringFlush

      public boolean wasReachedDuringFlush()
      Was this collection reached during the current flush?
      Since:
      8.0
    • markReachedDuringFlush

      public void markReachedDuringFlush()
      Marks this collection as reached during the current flush.
      Since:
      8.0
    • wasProcessedDuringFlush

      public boolean wasProcessedDuringFlush()
      Was this collection processed during the current flush?
      Since:
      8.0
    • markProcessedDuringFlush

      public void markProcessedDuringFlush()
      Marks this collection as processed during the current flush.
      Since:
      8.0
    • resetFlushState

      public void resetFlushState()
      Clears traversal state before collection reachability is re-evaluated within the same flush.
      Since:
      8.0
    • postInitialize

      public void postInitialize(PersistentCollection<?> collection, SharedSessionContractImplementor session)
    • postFlush

      public void postFlush(PersistentCollection<?> collection, CollectionFlushActionTracker collectionFlushActionTracker)
      Called after a successful flush
    • afterAction

      public void afterAction(PersistentCollection<?> collection)
      Called after execution of an action
    • getKey

      @Nullable public Object getKey()
    • getRole

      @Nullable public String getRole()
    • getSnapshot

      @Nullable public Serializable getSnapshot()
    • isReadOnly

      public boolean isReadOnly()
    • resetStoredSnapshot

      public void resetStoredSnapshot(PersistentCollection<?> collection, Serializable storedSnapshot)
      Reset the stored snapshot for both the persistent collection and this collection entry. Used during the merge of detached collections.
      Parameters:
      collection - the persistent collection to be updated
      storedSnapshot - the new stored snapshot
    • setReadOnly

      public void setReadOnly(boolean readOnly, PersistentCollection<?> collection)
    • wasDereferenced

      public boolean wasDereferenced()
    • isIgnore

      public boolean isIgnore()
    • getCurrentPersister

      @Nullable public CollectionPersister getCurrentPersister()
    • setCurrentPersister

      public void setCurrentPersister(@Nullable CollectionPersister currentPersister)
    • getCurrentKey

      @Nullable public Object getCurrentKey()
      This is only available late during the flush cycle
    • setCurrentKey

      public void setCurrentKey(@Nullable Object currentKey)
    • getLoadedPersister

      @Nullable public CollectionPersister getLoadedPersister()
      This is only available late during the flush cycle
    • getLoadedKey

      @Nullable public Object getLoadedKey()
    • setRole

      public void setRole(@Nullable String role)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getOrphans

      public Collection<?> getOrphans(String entityName, PersistentCollection<?> collection)
      Get the collection orphans (entities which were removed from the collection)
    • isSnapshotEmpty

      public boolean isSnapshotEmpty(PersistentCollection<?> collection)
    • serialize

      public void serialize(ObjectOutputStream oos) throws IOException
      Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance.
      Parameters:
      oos - The stream to which we should write the serial data.
      Throws:
      IOException
    • deserialize

      public static CollectionEntry deserialize(ObjectInputStream ois, SessionImplementor session) throws IOException, ClassNotFoundException
      Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance.
      Parameters:
      ois - The stream from which to read the entry.
      session - The session being deserialized.
      Returns:
      The deserialized CollectionEntry
      Throws:
      IOException
      ClassNotFoundException