Quantcast
Channel: Spring Community Forums - Data
Viewing all articles
Browse latest Browse all 297

Query methods that return lazy List/Iterable?

$
0
0
I may be missing something, but it seems that Spring Data is conspicuously missing the ability to perform a query that returns an arbitrarily large result set and load/process the rows on demand rather than loading the whole thing into memory at once. Is this available somewhere? Planned for a future release?

E.g. I'd expect to be able to write a query method such as:
Code:

Iterable<User> findAll();
And then be able to iterate over all Users in that collection without necessarily loading the whole collection into memory at once. Alternately, it might be done with a callback mechanism, similar to how JdbcTemplate.query() works, such as:
Code:

void findAll(HandleSingleResult<User> handler);

Viewing all articles
Browse latest Browse all 297

Trending Articles