|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.gps.device.jpa.indexer.HibernateJpaIndexEntitiesIndexer
public class HibernateJpaIndexEntitiesIndexer
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.
Also takes into accont if using HibernateJpaQueryProvider by called its createCriteria
instead of the default createQuery. The criteria better handles outer joins, allows to set the
fetch size, and automatically supports ordering by the ids of the entities.
Note, if using JpaGpsDevice.setIndexSelectQuery(Class, String) will cause
not to be able to use Criteria. Instead, make sure to use JpaGpsDevice.setIndexQueryProvider(Class, org.compass.gps.device.jpa.queryprovider.JpaQueryProvider)
and provider your own extension on top of HibernateJpaQueryProvider
that returns your own Criteria.
| Constructor Summary | |
|---|---|
HibernateJpaIndexEntitiesIndexer()
|
|
| Method Summary | |
|---|---|
void |
performIndex(CompassSession session,
IndexEntity[] entities)
Performs the actual indexing of the list of index entities. |
void |
setJpaGpsDevice(JpaGpsDevice jpaGpsDevice)
Sets the jpa 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 HibernateJpaIndexEntitiesIndexer()
| Method Detail |
|---|
public void setJpaGpsDevice(JpaGpsDevice jpaGpsDevice)
JpaIndexEntitiesIndexer
setJpaGpsDevice in interface JpaIndexEntitiesIndexerpublic 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 IndexEntitiesIndexersession - 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 | |||||||||