public void postInitialize(PersistentCollection collection) throws HibernateException { snapshot = getLoadedPersister().isMutable() ? collection.getSnapshot( getLoadedPersister() ) : null; collection.setSnapshot(loadedKey, role, snapshot); if ( getLoadedPersister().getBatchSize() > 1 ) { ( (AbstractPersistentCollection) collection ).getSession() .getPersistenceContext() .getBatchFetchQueue() .removeBatchLoadableCollection( this ); } }
private void evictCollection(PersistentCollection collection) { CollectionEntry ce = (CollectionEntry) getSession().getPersistenceContext().getCollectionEntries().remove(collection); if ( LOG.isDebugEnabled() ) { LOG.debugf( "Evicting collection: %s", MessageHelper.collectionInfoString( ce.getLoadedPersister(), collection, ce.getLoadedKey(), getSession() ) ); } if (ce.getLoadedPersister() != null && ce.getLoadedPersister().getBatchSize() > 1) { getSession().getPersistenceContext().getBatchFetchQueue().removeBatchLoadableCollection(ce); } if ( ce.getLoadedPersister() != null && ce.getLoadedKey() != null ) { //TODO: is this 100% correct? getSession().getPersistenceContext().getCollectionsByKey().remove( new CollectionKey( ce.getLoadedPersister(), ce.getLoadedKey() ) ); } }
public void postInitialize(PersistentCollection collection) throws HibernateException { snapshot = getLoadedCollectionDescriptor().getMutabilityPlan().isMutable() ? collection.getSnapshot( getLoadedCollectionDescriptor() ) : null; collection.setSnapshot(loadedKey, role, snapshot); if ( getLoadedCollectionDescriptor().getBatchSize() > 1 ) { ( (AbstractPersistentCollection) collection ).getSession() .getPersistenceContext() .getBatchFetchQueue() .removeBatchLoadableCollection( this ); } }
private void evictCollection(PersistentCollection collection) { CollectionEntry ce = (CollectionEntry) getSession().getPersistenceContext().getCollectionEntries().remove(collection); if ( LOG.isDebugEnabled() ) { LOG.debugf( "Evicting collection: %s", MessageHelper.collectionInfoString( ce.getLoadedCollectionDescriptor(), collection, ce.getLoadedKey(), getSession() ) ); } if (ce.getLoadedCollectionDescriptor() != null && ce.getLoadedCollectionDescriptor().getBatchSize() > 1) { getSession().getPersistenceContext().getBatchFetchQueue().removeBatchLoadableCollection(ce); } if ( ce.getLoadedCollectionDescriptor() != null && ce.getLoadedKey() != null ) { //TODO: is this 100% correct? getSession().getPersistenceContext().getCollectionsByKey().remove( new CollectionKey( ce.getLoadedCollectionDescriptor(), ce.getLoadedKey() ) ); } }