Reputation: 315
I have a page of object:
Page<Audit> audits = auditRepository.findAll(new PageRequest(1, 10));
And I want to convert audits to list of object. audit.getContent()
return just the single page's data. How to get everything from all pages?
Upvotes: 1
Views: 1920
Reputation: 30819
The (whole) point of pagination is to return partial data and page through it so you don't need to:
However, if you want to get everything in one go then, you can call the overloaded version of findAll
method (of JPARepository
) which accepts no arguments (Javadoc here). Your code would look like this:
List<Audit> audits = auditRepository.findAll();
Upvotes: 1