@Override public void addEntity(EntityKey key, Object entity) { entitiesByKey.put( key, entity ); if( batchFetchQueue != null ) { getBatchFetchQueue().removeBatchLoadableEntityKey(key); } }
@Override public Object removeEntity(EntityKey key) { final Object entity = entitiesByKey.remove( key ); final Iterator itr = entitiesByUniqueKey.values().iterator(); while ( itr.hasNext() ) { if ( itr.next() == entity ) { itr.remove(); } } // Clear all parent cache parentsByChild.clear(); entitySnapshotsByKey.remove( key ); nullifiableEntityKeys.remove( key ); if( batchFetchQueue != null ) { getBatchFetchQueue().removeBatchLoadableEntityKey(key); getBatchFetchQueue().removeSubselect(key); } return entity; }
@Override public void addUninitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id) { final CollectionEntry ce = new CollectionEntry( collection, persister, id, flushing ); addCollection( collection, ce, id ); if ( persister.getBatchSize() > 1 ) { getBatchFetchQueue().addBatchLoadableCollection( collection, ce ); } }
@Override public void addUninitializedDetachedCollection(CollectionPersister persister, PersistentCollection collection) { final CollectionEntry ce = new CollectionEntry( persister, collection.getKey() ); addCollection( collection, ce, collection.getKey() ); if ( persister.getBatchSize() > 1 ) { getBatchFetchQueue().addBatchLoadableCollection( collection, ce ); } }
@Override public void addEntity(EntityKey key, Object entity) { entitiesByKey.put(key, entity); getBatchFetchQueue().removeBatchLoadableEntityKey(key); }
@Override public void addEntity(EntityKey key, Object entity) { entitiesByKey.put(key, entity); getBatchFetchQueue().removeBatchLoadableEntityKey(key); }
@Override public void addEntity(EntityKey key, Object entity) { entitiesByKey.put( key, entity ); if( batchFetchQueue != null ) { getBatchFetchQueue().removeBatchLoadableEntityKey(key); } }
@Override public Object removeEntity(EntityKey key) { final Object entity = entitiesByKey.remove( key ); final Iterator itr = entitiesByUniqueKey.values().iterator(); while ( itr.hasNext() ) { if ( itr.next() == entity ) { itr.remove(); } } // Clear all parent cache parentsByChild.clear(); entitySnapshotsByKey.remove( key ); nullifiableEntityKeys.remove( key ); if( batchFetchQueue != null ) { getBatchFetchQueue().removeBatchLoadableEntityKey(key); getBatchFetchQueue().removeSubselect(key); } return entity; }
/** * Remove an entity from the session cache, also clear * up other state associated with the entity, all except * for the <tt>EntityEntry</tt> */ @Override public Object removeEntity(EntityKey key) { Object entity = entitiesByKey.remove(key); Iterator iter = entitiesByUniqueKey.values().iterator(); while ( iter.hasNext() ) { if ( iter.next()==entity ) iter.remove(); } // Clear all parent cache parentsByChild.clear(); entitySnapshotsByKey.remove(key); nullifiableEntityKeys.remove(key); getBatchFetchQueue().removeBatchLoadableEntityKey(key); getBatchFetchQueue().removeSubselect(key); return entity; }
/** * Remove an entity from the session cache, also clear * up other state associated with the entity, all except * for the <tt>EntityEntry</tt> */ @Override public Object removeEntity(EntityKey key) { Object entity = entitiesByKey.remove(key); Iterator iter = entitiesByUniqueKey.values().iterator(); while ( iter.hasNext() ) { if ( iter.next()==entity ) iter.remove(); } // Clear all parent cache parentsByChild.clear(); entitySnapshotsByKey.remove(key); nullifiableEntityKeys.remove(key); getBatchFetchQueue().removeBatchLoadableEntityKey(key); getBatchFetchQueue().removeSubselect(key); return entity; }
@Override public void addUninitializedCollection(PersistentCollectionDescriptor descriptor, PersistentCollection collection, Object collectionKey) { final CollectionEntry ce = new CollectionEntry( collection, descriptor, collectionKey, flushing ); if ( !collection.wasInitialized() ) { collection.beforeInitialize( -1, descriptor ); } addCollection( collection, ce, collectionKey ); if ( descriptor.getBatchSize() > 1 ) { getBatchFetchQueue().addBatchLoadableCollection( collection, ce ); } }
@Override public void addUninitializedDetachedCollection(PersistentCollectionDescriptor descriptor, PersistentCollection collection) { final CollectionEntry ce = new CollectionEntry( descriptor, collection.getKey() ); addCollection( collection, ce, collection.getKey() ); if ( descriptor.getBatchSize() > 1 ) { getBatchFetchQueue().addBatchLoadableCollection( collection, ce ); } }