Spring Data JPA's Pageable and @PageableDefault are not supported as Controller method types

See original GitHub issue

Quarkus 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:open
  • Created 4 years ago
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
geoandcommented, Sep 19, 2019

@hantsy FYI, the issue you encountered with not being able to return ResponseEntity<Page<Customer>> has now been fixed on master

0reactions
tkzhakunacommented, Apr 7, 2021

I 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){…}

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found