|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.compass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer
public class ScrollableHibernateIndexEntitiesIndexer
A Hibernate indexer uses Hibernate ScrollableResults
to index the database
instead of using setFirstResult
and setMaxResults
. Using scrollable
results yields better performance especially for large result set.
First tries to call HibernateQueryProvider.createCriteria(org.hibernate.Session, org.compass.gps.device.hibernate.entities.EntityInformation)
in order to use Hibernate Criteria
to construct the cursor. If no criteria is returned (null
is returned), Hibernate Query
is used by calling HibernateQueryProvider.createQuery(org.hibernate.Session, org.compass.gps.device.hibernate.entities.EntityInformation)
.
When using Criteria, by default, orders the results by entity id. This can be turned off either globablly using
setPerformOrderById(boolean)
, or per entity using setPerformOrderById(String, boolean)
.
Constructor Summary | |
---|---|
ScrollableHibernateIndexEntitiesIndexer()
|
Method Summary | |
---|---|
void |
performIndex(CompassSession session,
IndexEntity[] entities)
Performs the actual indexing of the list of index entities. |
void |
setHibernateGpsDevice(HibernateGpsDevice device)
Sets the Hibernate gps device for the given indexer. |
void |
setPerformOrderById(boolean performOrderById)
Should this indxer order by the ids when Criteria is available. |
void |
setPerformOrderById(String entity,
boolean performOrderById)
Should this indxer order by the ids when Criteria is available for
the given entity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScrollableHibernateIndexEntitiesIndexer()
Method Detail |
---|
public void setHibernateGpsDevice(HibernateGpsDevice device)
HibernateIndexEntitiesIndexer
setHibernateGpsDevice
in interface HibernateIndexEntitiesIndexer
public void setPerformOrderById(boolean performOrderById)
Criteria
is available.
Defaults to true
.
public void setPerformOrderById(String entity, boolean performOrderById)
Criteria
is available for
the given entity. Defaults to setPerformOrderById(boolean)
.
public void performIndex(CompassSession session, IndexEntity[] entities)
IndexEntitiesIndexer
performIndex
in interface IndexEntitiesIndexer
session
- The compass session to index the data withentities
- A list of entities to perform the indexing by
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |