public class BatchFetchQueue extends Object
Constructor and Description |
---|
BatchFetchQueue(PersistenceContext context)
Constructs a queue for the given context.
|
Modifier and Type | Method and Description |
---|---|
void |
addBatchLoadableCollection(PersistentCollection collection,
CollectionEntry ce)
If a CollectionEntry represents a batch loadable collection, add
it to the queue.
|
void |
addBatchLoadableEntityKey(EntityKey key)
If an EntityKey represents a batch loadable entity, add
it to the queue.
|
void |
addSubselect(EntityKey key,
SubselectFetch subquery)
Adds a subselect fetch decriptor for the given entity key.
|
void |
clear()
Clears all entries from this fetch queue.
|
boolean |
containsEntityKey(EntityKey key)
Intended for test usage.
|
Serializable[] |
getCollectionBatch(CollectionPersister collectionPersister,
Serializable id,
int batchSize)
Get a batch of uninitialized collection keys for a given role
|
Serializable[] |
getEntityBatch(EntityPersister persister,
Serializable id,
int batchSize,
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.
|
SubselectFetch |
getSubselect(EntityKey key)
Retrieve the fetch descriptor associated with the given entity key.
|
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
|
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
|
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)
|
public BatchFetchQueue(PersistenceContext context)
context
- The owning context.public void clear()
public SubselectFetch getSubselect(EntityKey key)
key
- The entity key for which to locate any defined subselect fetch.public void addSubselect(EntityKey key, SubselectFetch subquery)
key
- The entity for which to register the subselect fetch.subquery
- The fetch descriptor.public void removeSubselect(EntityKey key)
public void addBatchLoadableEntityKey(EntityKey key)
PersistenceContext
; failure to do so may cause the
referenced entity to be included in a batch even though it is
already associated with the PersistenceContext
.public void removeBatchLoadableEntityKey(EntityKey key)
public boolean containsEntityKey(EntityKey key)
public Serializable[] getEntityBatch(EntityPersister persister, Serializable id, int batchSize, EntityMode entityMode)
persister
- The persister for the entities being loaded.id
- The identifier of the entity currently demanding load.batchSize
- The maximum number of keys to returnpublic void addBatchLoadableCollection(PersistentCollection collection, CollectionEntry ce)
public void removeBatchLoadableCollection(CollectionEntry ce)
public Serializable[] getCollectionBatch(CollectionPersister collectionPersister, Serializable id, int batchSize)
collectionPersister
- The persister for the collection role.id
- A key that must be included in the batch fetchbatchSize
- the maximum number of keys to returnCopyright © 2019 JBoss by Red Hat. All rights reserved.