/** * Intended for test usage. Really has no use-case in Hibernate proper. */ public boolean containsEntityKey(EntityKey key) { if ( key.isBatchLoadable() ) { LinkedHashSet<EntityKey> set = batchLoadableEntityKeys.get( key.getEntityName()); if ( set != null ) { return set.contains( key ); } } return false; }
/** * After evicting or deleting or loading an entity, we don't * need to batch fetch it anymore, remove it from the queue * if necessary */ public void removeBatchLoadableEntityKey(EntityKey key) { if ( key.isBatchLoadable() ) { LinkedHashSet<EntityKey> set = batchLoadableEntityKeys.get( key.getEntityName()); if (set != null) { set.remove(key); } } }
/** * If an EntityKey represents a batch loadable entity, add * it to the queue. * <p/> * Note that the contract here is such that any key passed in should * previously have been been checked for existence within the * {@link PersistenceContext}; failure to do so may cause the * referenced entity to be included in a batch even though it is * already associated with the {@link PersistenceContext}. */ public void addBatchLoadableEntityKey(EntityKey key) { if ( key.isBatchLoadable() ) { LinkedHashSet<EntityKey> set = batchLoadableEntityKeys.get( key.getEntityName()); if (set == null) { set = new LinkedHashSet<>( 8 ); batchLoadableEntityKeys.put( key.getEntityName(), set); } set.add(key); } }
/** * After evicting or deleting or loading an entity, we don't * need to batch fetch it anymore, remove it from the queue * if necessary */ public void removeBatchLoadableEntityKey(EntityKey key) { if ( key.isBatchLoadable() ) batchLoadableEntityKeys.remove(key); }
/** * After evicting or deleting or loading an entity, we don't * need to batch fetch it anymore, remove it from the queue * if necessary */ public void removeBatchLoadableEntityKey(EntityKey key) { if ( key.isBatchLoadable() ) batchLoadableEntityKeys.remove(key); }
/** * If an EntityKey represents a batch loadable entity, add * it to the queue. * <p/> * Note that the contract here is such that any key passed in should * previously have been been checked for existence within the * {@link PersistenceContext}; failure to do so may cause the * referenced entity to be included in a batch even though it is * already associated with the {@link PersistenceContext}. */ public void addBatchLoadableEntityKey(EntityKey key) { if ( key.isBatchLoadable() ) { batchLoadableEntityKeys.put( key, MARKER ); } }
/** * If an EntityKey represents a batch loadable entity, add * it to the queue. * <p/> * Note that the contract here is such that any key passed in should * previously have been been checked for existence within the * {@link PersistenceContext}; failure to do so may cause the * referenced entity to be included in a batch even though it is * already associated with the {@link PersistenceContext}. */ public void addBatchLoadableEntityKey(EntityKey key) { if ( key.isBatchLoadable() ) { batchLoadableEntityKeys.put( key, MARKER ); } }
/** * After evicting or deleting or loading an entity, we don't * need to batch fetch it anymore, remove it from the queue * if necessary */ public void removeBatchLoadableEntityKey(EntityKey key) { if ( key.isBatchLoadable() ) { LinkedHashSet<EntityKey> set = batchLoadableEntityKeys.get( key.getEntityName()); if (set != null) { set.remove(key); } } }
/** * Intended for test usage. Really has no use-case in Hibernate proper. */ public boolean containsEntityKey(EntityKey key) { if ( key.isBatchLoadable() ) { LinkedHashSet<EntityKey> set = batchLoadableEntityKeys.get( key.getEntityName()); if ( set != null ) { return set.contains( key ); } } return false; }
/** * If an EntityKey represents a batch loadable entity, add * it to the queue. * <p/> * Note that the contract here is such that any key passed in should * previously have been been checked for existence within the * {@link PersistenceContext}; failure to do so may cause the * referenced entity to be included in a batch even though it is * already associated with the {@link PersistenceContext}. */ public void addBatchLoadableEntityKey(EntityKey key) { if ( key.isBatchLoadable() ) { LinkedHashSet<EntityKey> set = batchLoadableEntityKeys.get( key.getEntityName()); if (set == null) { set = new LinkedHashSet<>( 8 ); batchLoadableEntityKeys.put( key.getEntityName(), set); } set.add(key); } }