Reputation: 10822
Is there a way to iterate query results through JPA API, similar to Hibernate's Criteria.scroll()
method? It is big performance improvement with big resultsets, rows can be processed as they are read.
Upvotes: 1
Views: 333
Reputation: 42114
No, there is not such a construct in JPA. Also not in JPA 2.1.
JPA 2.2 provides TypedQuery.getResultStream(), but default implementation does not have expected effect (calls getResultList). Also specific implementations do not always lead to performance improvements, as can be seen in this article.
Upvotes: 1