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
org.compass.gps.device.jpa.JpaGpsDevice.setIndexSelectQuery(ClassString) will cause
not to be able to use Criteria . Instead, make sure to use
org.compass.gps.device.jpa.JpaGpsDevice.setIndexQueryProvider(Classorg.compass.gps.device.jpa.queryprovider.JpaQueryProvider) and provider your own extension on top of
org.compass.gps.device.jpa.queryprovider.HibernateJpaQueryProvider that returns your own Criteria .
author: kimchy |