public abstract class AbstractBatchFinder extends Object implements BatchFinder
processBatchFind(long, java.util.Collection, Class)
which performs the hibernate version specific
search.
Callback methods beforeFind()
and afterFind()
can be used to wrap the search in a session
and/or transaction.
Constructor and Description |
---|
AbstractBatchFinder() |
Modifier and Type | Method and Description |
---|---|
protected void |
afterFind() |
protected void |
beforeFind() |
<E extends Serializable> |
find(long directoryID,
Collection<String> names,
Class<E> persistentClass)
Returns a collection of entities that match the
names provided.
|
protected abstract <E> Collection<E> |
processBatchFind(long directoryID,
Collection<String> names,
Class<E> persistentClass) |
void |
setBatchSize(int batchSize) |
public void setBatchSize(int batchSize)
public <E extends Serializable> Collection<E> find(long directoryID, Collection<String> names, Class<E> persistentClass)
Internally, this performs a:
SELECT * FROM entityTable WHERE entityName IN (...)
This is batched such that the size of the IN
clause is at most the batchSize
.
find
in interface BatchFinder
directoryID
- directory ID of the entities to return.names
- collection of entity names. This, along with the directoryID
should form the primary key of the entity.persistentClass
- the persistent class to lookup. This must
be a Hibernate-mapped DirectoryEntity.protected void beforeFind()
protected void afterFind()
protected abstract <E> Collection<E> processBatchFind(long directoryID, Collection<String> names, Class<E> persistentClass)
Copyright © 2021 Atlassian. All rights reserved.