Hi, dear,
When I am trying to address a memory and performance issue for large data set reading , I found the Query.iterate() best meets my requirement. But the Hibernate Criteria doesn't support iterate(), and it is the best way for me to generate query, instead of HQL. Do I need to convert Criteria to Query(HQL) to get Iterator? how to convert? or is there any other approach to achieve it? 1. I want to use Hibernate Iterator; 2. I want to use Criteria to generate query.
BTW, the ScrollableResultSets (Criteria provides) consumes too big memory to store those EntityKey, so I like to use Iterator to minimize memory usage.
Thanks for any answer!
|