If you can do it in SQL you can do it in HQL...
What would be the SQL way?
It depends if the list is updated frequenly or not. I dont know the best way to do it, but you can cache the result if it not too heavy, cache only the ids, or make a count one time and modify the HQL to navigate in the result list... (remember only the last id of the 10th element), or make a count each time and reajust the query, if the list can change each minute...
It depends of the kind of search engine you want.
Etienne.
|