Pagination in Spring Data JPA (limit and offset)

后端 未结 7 1058
眼角桃花
眼角桃花 2020-12-02 08:54

I want the user to be able to specify the limit (the size of the amount returned) and offset (the first record returned / index returned) in my query method.

Here a

7条回答
  •  误落风尘
    2020-12-02 09:16

    You probably can't to this with spring data jpa. If the offset is very small, you might just remove the top X statements from the query after retrieval.

    Otherwise, you could define the page size to be the offset and start at page+1.

提交回复
热议问题