Class ReloadablePersistentSet<T>

java.lang.Object
org.hibernate.collection.spi.AbstractPersistentCollection<T>
org.hibernate.collection.spi.PersistentSet<T>
ch.tocco.nice2.persist.core.impl.hibernate.usertype.ReloadablePersistentSet<T>
All Implemented Interfaces:
Serializable, Iterable<T>, Collection<T>, Set<T>, org.hibernate.collection.spi.LazyInitializable, org.hibernate.collection.spi.PersistentCollection<T>

public class ReloadablePersistentSet<T> extends org.hibernate.collection.spi.PersistentSet<T>
Extension of PersistentSet which supports reloading. Added and removed entities are tracked locally and are re-added/removed after reloading. If a removed entity is not part of the reloaded collection, an exception is thrown, as the remove would get lost.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.hibernate.collection.spi.AbstractPersistentCollection

    org.hibernate.collection.spi.AbstractPersistentCollection.AbstractValueDelayedOperation, org.hibernate.collection.spi.AbstractPersistentCollection.DelayedOperation<E>, org.hibernate.collection.spi.AbstractPersistentCollection.IteratorProxy<E>, org.hibernate.collection.spi.AbstractPersistentCollection.LazyInitializationWork<T>, org.hibernate.collection.spi.AbstractPersistentCollection.ListIteratorProxy, org.hibernate.collection.spi.AbstractPersistentCollection.ListProxy, org.hibernate.collection.spi.AbstractPersistentCollection.SetProxy<E>, org.hibernate.collection.spi.AbstractPersistentCollection.ValueDelayedOperation<E>
  • Field Summary

    Fields inherited from class org.hibernate.collection.spi.PersistentSet

    set

    Fields inherited from class org.hibernate.collection.spi.AbstractPersistentCollection

    elementRemoved, UNKNOWN
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReloadablePersistentSet(org.hibernate.engine.spi.SharedSessionContractImplementor session)
     
    ReloadablePersistentSet(org.hibernate.engine.spi.SharedSessionContractImplementor session, Set set)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(T value)
     
    boolean
     
    boolean
     
    void
     
    void
    reloadCollection(org.hibernate.engine.spi.SessionImplementor session)
     
    boolean
    remove(Object object)
     

    Methods inherited from class org.hibernate.collection.spi.PersistentSet

    addAll, clear, contains, containsAll, disassemble, empty, entries, entryExists, equals, equalsSnapshot, getDeletes, getElement, getIndex, getOrphans, getSnapshot, getSnapshotElement, hashCode, initializeEmptyCollection, initializeFromCache, injectLoadedState, isEmpty, isRowUpdatePossible, isWrapper, iterator, needsInserting, needsUpdating, removeAll, retainAll, size, toArray, toArray, toString

    Methods inherited from class org.hibernate.collection.spi.AbstractPersistentCollection

    afterInitialize, afterRowInsert, beforeInitialize, beginRead, clearDirty, clearOperationQueue, dirty, elementByIndex, elementExists, forceInitialization, getCachedSize, getIdentifier, getKey, getOrphans, getOwner, getQueuedOrphans, getRole, getSession, getSize, getSnapshot, getStoredSnapshot, getValue, hasQueuedOperations, identityRemove, initialize, isClearQueueEnabled, isConnectedToSession, isDirectlyAccessible, isDirty, isElementRemoved, isInitialized, isInitializing, isInverseCollection, isInverseCollectionNoOrphanDelete, isInverseOneToManyOrNoOrphanDelete, isOperationQueueEnabled, isPutQueueEnabled, isUnreferenced, needsRecreate, performQueuedOperations, preInsert, prepareForPossibleLoadingOutsideTransaction, queuedAdditionIterator, queueOperation, read, readElementByIndex, readElementExistence, readIndexExistence, readSize, replaceQueuedOperationValues, setCurrentSession, setDirectlyAccessible, setInitialized, setOwner, setSnapshot, unsetSession, wasInitialized, write

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Collection

    parallelStream, removeIf, stream, toArray

    Methods inherited from interface java.lang.Iterable

    forEach

    Methods inherited from interface org.hibernate.collection.spi.PersistentCollection

    includeInInsert, includeInRecreate, isDirectlyProvidedCollection, isNewlyInstantiated, needsUpdating, render

    Methods inherited from interface java.util.Set

    spliterator
  • Constructor Details

    • ReloadablePersistentSet

      public ReloadablePersistentSet(org.hibernate.engine.spi.SharedSessionContractImplementor session)
    • ReloadablePersistentSet

      public ReloadablePersistentSet(org.hibernate.engine.spi.SharedSessionContractImplementor session, Set set)
  • Method Details

    • add

      public boolean add(T value)
      Specified by:
      add in interface Collection<T>
      Specified by:
      add in interface Set<T>
      Overrides:
      add in class org.hibernate.collection.spi.PersistentSet<T>
    • remove

      public boolean remove(Object object)
      Specified by:
      remove in interface Collection<T>
      Specified by:
      remove in interface Set<T>
      Overrides:
      remove in class org.hibernate.collection.spi.PersistentSet<T>
    • endRead

      public boolean endRead()
      Specified by:
      endRead in interface org.hibernate.collection.spi.PersistentCollection<T>
      Overrides:
      endRead in class org.hibernate.collection.spi.AbstractPersistentCollection<T>
    • postAction

      public void postAction()
      Specified by:
      postAction in interface org.hibernate.collection.spi.PersistentCollection<T>
      Overrides:
      postAction in class org.hibernate.collection.spi.AbstractPersistentCollection<T>
    • isSnapshotEmpty

      public boolean isSnapshotEmpty(Serializable snapshot)
      Specified by:
      isSnapshotEmpty in interface org.hibernate.collection.spi.PersistentCollection<T>
      Overrides:
      isSnapshotEmpty in class org.hibernate.collection.spi.PersistentSet<T>
    • reloadCollection

      public void reloadCollection(org.hibernate.engine.spi.SessionImplementor session)