Announcement Announcement Module
Collapse
No announcement yet.
Total pagination parameters missing in JSON response Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Total pagination parameters missing in JSON response

    Hi,

    when using pagination parameters for a call to my Spring Data REST-based URL, I get a correctly paged result with paging values for offset, page etc. However, the parameters for totalPages and totalElements are missing. I have simply extended my repository from PagingAndSortingRepository - do I have to do additional configuration for this?

  • #2
    What backing store (module) are you using? IIRC not all stores can calculate total results (cheaply), so they might not calculate it, see https://github.com/SpringSource/spri...Feature-matrix

    Comment


    • #3
      I am using JPA with Hibernate. Maybe it's because I'm using HSQLDB? I thought that supports a COUNT query.

      Comment


      • #4
        For that configuration (I used the exact same one in a project a couple of months ago), it should work out of the box, without any additional configuration required to get the total* elements to show. HSQLDB shouldn't the a problem either - it's used in the sample project (Spring Data book) without issues ...

        Comment

        Working...
        X