List of usage examples for org.springframework.data.repository PagingAndSortingRepository findAll
Page<T> findAll(Pageable pageable);
From source file:org.openlmis.fulfillment.AuditLogInitializer.java
private void createSnapshots(PagingAndSortingRepository<?, ?> repository) { Pageable pageable = new PageRequest(DEFAULT_PAGE_NUMBER, 2000); while (true) { Page<?> page = repository.findAll(pageable); if (!page.hasContent()) { break; }/*from w ww .j a v a2 s .c o m*/ page.forEach(this::createSnapshot); pageable = pageable.next(); } }