-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
in: coreIssues in core supportIssues in core supportstatus: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancementA general enhancement
Description
László Csatlós opened DATAJPA-1438 and commented
Actual method findAll(Specification<T> spec)
on interface JpaSpecificationExecutor<T>
can return only with List
or Page
but not with Stream<T>
.
This would be useful for huge resultSets combined with @QueryHint(name="org.hibernate.fetchSize", value="50" )
to truly benefit the power of streaming concept and not to exhaust all of the JVM memory. Hibernate already has the capability to do this with ScrollableResults
:
Query query = session.createQuery(query);
query.setReadOnly(true);
query.setFetchSize(100);
ScrollableResults results = query.scroll(ScrollMode.FORWARD_ONLY);
If ambiguous method name is a problem (mentioned at DATAJPA-906), then a
Stream<T> streamAll(Specification<T> spec, Long fetchSize)
signiture would also perfect
2 votes, 3 watchers
denis111, besbes, Jakub-B, quaff, lbreuss and 2 more
Metadata
Metadata
Labels
in: coreIssues in core supportIssues in core supportstatus: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancementA general enhancement