@Override public Object removeProxy(EntityKey key) { if ( batchFetchQueue != null ) { batchFetchQueue.removeBatchLoadableEntityKey( key ); batchFetchQueue.removeSubselect( key ); } return proxiesByKey.remove( 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 the entity key with the specified {@code id} and {@code persister} from * the batch loadable entities {@link BatchFetchQueue}. * * @param id - the ID for the entity to be removed * @param persister - the entity persister * @param session - the session */ public static void removeBatchLoadableEntityKey( Serializable id, EntityPersister persister, SharedSessionContractImplementor session) { final EntityKey entityKey = session.generateEntityKey( id, persister ); final BatchFetchQueue batchFetchQueue = session.getPersistenceContext().getBatchFetchQueue(); batchFetchQueue.removeBatchLoadableEntityKey( entityKey ); } }
@Override public Object removeProxy(EntityKey key) { if ( batchFetchQueue != null ) { batchFetchQueue.removeBatchLoadableEntityKey( key ); batchFetchQueue.removeSubselect( key ); } return proxiesByKey.remove( 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); getBatchFetchQueue().removeBatchLoadableEntityKey(key); }
@Override public void addEntity(EntityKey key, Object entity) { entitiesByKey.put( key, entity ); if( batchFetchQueue != null ) { getBatchFetchQueue().removeBatchLoadableEntityKey(key); } }
/** * Remove a proxy from the session cache. * <p/> * Additionally, ensure that any load optimization references * such as batch or subselect loading get cleaned up as well. * * @param key The key of the entity proxy to be removed * @return The proxy reference. */ @Override public Object removeProxy(EntityKey key) { if ( batchFetchQueue != null ) { batchFetchQueue.removeBatchLoadableEntityKey( key ); batchFetchQueue.removeSubselect( key ); } return proxiesByKey.remove( key ); }
/** * Remove a proxy from the session cache. * <p/> * Additionally, ensure that any load optimization references * such as batch or subselect loading get cleaned up as well. * * @param key The key of the entity proxy to be removed * @return The proxy reference. */ @Override public Object removeProxy(EntityKey key) { if ( batchFetchQueue != null ) { batchFetchQueue.removeBatchLoadableEntityKey( key ); batchFetchQueue.removeSubselect( key ); } return proxiesByKey.remove( 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; }
/** * Remove the entity key with the specified {@code id} and {@code descriptor} from * the batch loadable entities {@link BatchFetchQueue}. * * @param id - the ID for the entity to be removed * @param descriptor - the entity descriptor * @param session - the session */ public static void removeBatchLoadableEntityKey( Serializable id, EntityTypeDescriptor descriptor, SharedSessionContractImplementor session) { final EntityKey entityKey = session.generateEntityKey( id, descriptor ); final BatchFetchQueue batchFetchQueue = session.getPersistenceContext().getBatchFetchQueue(); batchFetchQueue.removeBatchLoadableEntityKey( entityKey ); } }