Spring Data JPA's Pageable and @PageableDefault are not supported as Controller method types
See original GitHub issueQuarkus 0.22.0
Both Page result, Pageable params are not worked as expected.
https://github.com/hantsy/quarkus-sample/tree/master/spring-post-service
@GetMapping()
public ResponseEntity getAllPosts(
@RequestParam(value = "q", required = false) String keyword,
@RequestParam(value = "page", required = false, defaultValue = "0") int page,
@RequestParam(value = "size", required = false, defaultValue = "10") int size
/** //
@PageableDefault(page = 0, size = 10, sort = "createdDate", direction = Direction.DESC) Pageable page*/) {
//Page<Post> posts = this.postRepository.findAll(PageRequest.of(page, size));
List<Post> posts = this.postRepository.findAll();
return ok(posts);
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (14 by maintainers)
Top Results From Across the Web
Spring Data Web Support - Baeldung
Spring MVC supports the use of Pageable types in controllers and repositories. Simply put, a Pageable instance is an object that holds paging...
Read more >spring data jpa limit pagesize, how to set to maxSize
and in my Java code, I use spring data jpa Pageable class, Pageable pageable = new PageRequest( queryForm.getPageNumber()- 1, queryForm.
Read more >Paging with Spring Boot - Reflectoring
An in-depth look at the paging support provided by Spring Data for querying Spring Web MVC controllers and Spring Data repositories.
Read more >PageableDefault (Spring Data Core 3.0.0 API)
declaration: package: org.springframework.data.web, annotation type: ... Annotation to set defaults when injecting a Pageable into a controller method.
Read more >Spring Data JPA - Web support, Sorting And Pagination
This annotation defines the default Sort options to be used when injecting a Sort instance into a controller handler method.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@hantsy FYI, the issue you encountered with not being able to return
ResponseEntity<Page<Customer>>has now been fixed onmasterI got the same problem in my Rest Controller but this used to work : findAll(Pageable pageable){…}
Also tried this without success: findAll(@RequestParam(“offset”)int offset,@RequestParam(“pageNumber”)int pageNumber, @RequestParam(“pageSize”) int pageSize,@RequestParam(“paged”)boolean paged, @RequestParam(“unpaged”) boolean unpaged, final Pageable pageable){…}