Skip to content

Instantly share code, notes, and snippets.

View megabites2013's full-sized avatar

SebastianX3024915 megabites2013

View GitHub Profile
@josericardo
josericardo / PageableCollection.java
Last active September 26, 2023 06:21
Helper to iterate over pageable sources. Should reduce memory usage when querying large tables via Spring Data.
======================================
Usage:
Fetcher<Source, MyEntity> f = new Fetcher<Source, MyEntity>(source) {
@Override
public List<MyEntity> fetch(Pageable pageRequest)
{
return source.findAll(pageRequest);
}
};