| Modifier and Type | Field and Description |
|---|---|
| private Map | batchLoadableCollections
Used to hold information about the collections that are currently eligible for batch-fetching. |
| private Map | batchLoadableEntityKeys
Used to hold information about the entities that are currently eligible for batch-fetching. |
| private final PersistenceContext | |
| private static final Logger | |
| private Map | subselectsByEntityKey
A map of |
| Access | Constructor and Description |
|---|---|
| public | BatchFetchQueue(PersistenceContext
The owning context. context)Constructs a queue for the given context. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addBatchLoadableCollection(PersistentCollection collection, CollectionEntry ce)
If a CollectionEntry represents a batch loadable collection, add it to the queue. |
| public void | addBatchLoadableEntityKey(EntityKey key)
If an EntityKey represents a batch loadable entity, add it to the queue. |
| public void | addSubselect(EntityKey
The entity for which to register the subselect fetch. key, SubselectFetch The fetch descriptor. subquery)Adds a subselect fetch descriptor for the given entity key. |
| public void | |
| public boolean | |
| public Serializable[] | Returns: an array of collection keys, of length batchSize (padded with nulls)The persister for the collection role. collectionPersister, final Serializable A key that must be included in the batch fetch id, final int the maximum number of keys to return batchSize)Get a batch of uninitialized collection keys for a given role |
| public Serializable[] | Returns: an array of identifiers, of length batchSize (possibly padded with nulls)The persister for the entities being loaded. persister, final Serializable The identifier of the entity currently demanding load. id, final int The maximum number of keys to return batchSize, final EntityMode entityMode)Get a batch of unloaded identifiers for this class, using a slightly complex algorithm that tries to grab keys registered immediately after the given key. |
| public SubselectFetch | Returns: The fetch descriptor; may return null if no subselect fetch queued for this entity key.The entity key for which to locate any defined subselect fetch. key)Retrieve the fetch descriptor associated with the given entity key. |
| private boolean | |
| private boolean | |
| public void | removeBatchLoadableCollection(CollectionEntry ce)
After a collection was initialized or evicted, we don't need to batch fetch it anymore, remove it from the queue if necessary |
| public void | removeBatchLoadableEntityKey(EntityKey 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 | removeSubselect(EntityKey key)
After evicting or deleting an entity, we don't need to know the query that was used to load it anymore (don't call this after loading the entity, since we might still need to load its collections) |
| batchLoadableCollections | back to summary |
|---|---|
| private Map<String, LinkedHashMap<CollectionEntry, PersistentCollection>> batchLoadableCollections Used to hold information about the collections that are currently eligible for batch-fetching. Ultimately
used by | |
| batchLoadableEntityKeys | back to summary |
|---|---|
| private Map<String, LinkedHashSet<EntityKey>> batchLoadableEntityKeys Used to hold information about the entities that are currently eligible for batch-fetching. Ultimately
used by A Map structure is used to segment the keys by entity type since loading can only be done for a particular entity type at a time. | |
| context | back to summary |
|---|---|
| private final PersistenceContext context | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| subselectsByEntityKey | back to summary |
|---|---|
| private Map<EntityKey, SubselectFetch> subselectsByEntityKey A map of | |
| BatchFetchQueue | back to summary |
|---|---|
| public BatchFetchQueue(PersistenceContext context) Constructs a queue for the given context.
| |
| addBatchLoadableCollection | back to summary |
|---|---|
| public void addBatchLoadableCollection(PersistentCollection collection, CollectionEntry ce) If a CollectionEntry represents a batch loadable collection, add it to the queue. | |
| addBatchLoadableEntityKey | back to summary |
|---|---|
| public void addBatchLoadableEntityKey(EntityKey key) If an EntityKey represents a batch loadable entity, add it to the queue.
Note that the contract here is such that any key passed in should
previously have been been checked for existence within the
| |
| addSubselect | back to summary |
|---|---|
| public void addSubselect(EntityKey key, SubselectFetch subquery) Adds a subselect fetch descriptor for the given entity key.
| |
| clear | back to summary |
|---|---|
| public void clear() Clears all entries from this fetch queue. Called after flushing or clearing the session. | |
| containsEntityKey | back to summary |
|---|---|
| public boolean containsEntityKey(EntityKey key) Intended for test usage. Really has no use-case in Hibernate proper. | |
| getCollectionBatch | back to summary |
|---|---|
| public Serializable[] getCollectionBatch(final CollectionPersister collectionPersister, final Serializable id, final int batchSize) Get a batch of uninitialized collection keys for a given role
| |
| getEntityBatch | back to summary |
|---|---|
| public Serializable[] getEntityBatch(final EntityPersister persister, final Serializable id, final int batchSize, final EntityMode entityMode) Get a batch of unloaded identifiers for this class, using a slightly complex algorithm that tries to grab keys registered immediately after the given key.
| |
| getSubselect | back to summary |
|---|---|
| public SubselectFetch getSubselect(EntityKey key) Retrieve the fetch descriptor associated with the given entity key.
| |
| isCached | back to summary |
|---|---|
| private boolean isCached(EntityKey entityKey, EntityPersister persister) | |
| isCached | back to summary |
|---|---|
| private boolean isCached(Serializable collectionKey, CollectionPersister persister) | |
| removeBatchLoadableCollection | back to summary |
|---|---|
| public void removeBatchLoadableCollection(CollectionEntry ce) After a collection was initialized or evicted, we don't need to batch fetch it anymore, remove it from the queue if necessary | |
| removeBatchLoadableEntityKey | back to summary |
|---|---|
| public void removeBatchLoadableEntityKey(EntityKey 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 | |
| removeSubselect | back to summary |
|---|---|
| public void removeSubselect(EntityKey key) After evicting or deleting an entity, we don't need to know the query that was used to load it anymore (don't call this after loading the entity, since we might still need to load its collections) | |