iterate « Criteria « JPA Q&A





1. Why Criteria doesn't support iterate()?    forum.hibernate.org

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 ...

2. Criteria does not have iterate() method    forum.hibernate.org

1 Criteria does not have iterate() method, so it can not pull object from cache 2 Criteria does not have a method to get the query string it constructs when i use Query class, i can do this: give me the query string, for example "select foo from Foo foo", i can construct a new query "select count(foo) from Foo foo" ...

3. Why is Criteria.iterate() method missing ?    forum.hibernate.org

I am currently working with the Criteria API quite a bit, and this stood out as a big red flag to me, as well. The lack of ability to utilize the 2nd-level cache is a definite issue, and I don't see how the people who are currently using the Criteria API haven't been bringing this up more often. I see that ...

4. Adding iterate() to Criteria    forum.hibernate.org

public class ScrollableResultsIteratorImpl implements Iterator { public ScrollableResultsIteratorImpl(ScrollableResults scrollableResult) { this.scrollableResult = scrollableResult; } private ScrollableResults scrollableResult = null; public boolean hasNext() { return !scrollableResult.isLast(); } public Object next() { ...