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
org.compass.gps.device.hibernate.HibernateQueryProvider.createCriteria(org.hibernate.Sessionorg.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
org.compass.gps.device.hibernate.HibernateQueryProvider.createQuery(org.hibernate.Sessionorg.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
ScrollableHibernateIndexEntitiesIndexer.setPerformOrderById(boolean) , or per entity using
ScrollableHibernateIndexEntitiesIndexer.setPerformOrderById(String,boolean) .
author: kimchy |