diff --git a/src/main/asciidoc/repositories.adoc b/src/main/asciidoc/repositories.adoc index 2ca5cb790..50b2bbc71 100644 --- a/src/main/asciidoc/repositories.adoc +++ b/src/main/asciidoc/repositories.adoc @@ -69,7 +69,7 @@ To access the second page of `User` by a page size of 20, you could do something [source, java] ---- PagingAndSortingRepository repository = // … get access to a bean -Page users = repository.findAll(new PageRequest(1, 20)); +Page users = repository.findAll(PageRequest.of(1, 20)); ---- In addition to query methods, query derivation for both count and delete queries is available. The following list shows the interface definition for a derived count query: @@ -1234,7 +1234,7 @@ String showUsers(Model model, you have to populate `thing1_page` and `thing2_page` and so on. -The default `Pageable` passed into the method is equivalent to a `new PageRequest(0, 20)` but can be customized by using the `@PageableDefault` annotation on the `Pageable` parameter. +The default `Pageable` passed into the method is equivalent to a `PageRequest.of(0, 20)` but can be customized by using the `@PageableDefault` annotation on the `Pageable` parameter. [[core.web.pageables]] ==== Hypermedia Support for Pageables