Skip to content

Instantly share code, notes, and snippets.

@moriya-hm5

moriya-hm5/pageable

Created Oct 6, 2019
Embed
What would you like to do?
int i = 0; // ページの基底値
int size = 5; // 1ページ当たりのデータ件数
Page<AccountEntity> paging = accountRepository.findAll(PageRequest.of(i, size));
while(paging.hasContent()) {
List<AccountEntity> list = paging.getContent();
list.stream().forEach(e -> System.out.println(e.getAaa().getAccountNumber()));
paging = accountRepository.findAll(PageRequest.of(++i, size));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment