Skip to content

It's simple demo show how to work with pagination in Spring Data JPA.

Notifications You must be signed in to change notification settings

nerdxio/api-pagination-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Api-Pagination-Demo

This is a demo project to show how to implement pagination in a REST API using Spring Boot.

Try it

curl -X GET http://localhost:8080/api/v1/person?page=0&size=2
{
  "content": [
    {
      "id": 1,
      "firstName": "Keneth",
      "lastName": "Gerlach",
      "phoneNumber": "1-590-109-6548",
      "email": "lavern.toy@yahoo.com",
      "address": {
        "id": 1,
        "address": "8101 Harber Isle",
        "city": "Kuvalisport",
        "state": "Oregon",
        "zip": "87187-4763"
      }
    },
    {
      "id": 2,
      "firstName": "Chuck",
      "lastName": "Wyman",
      "phoneNumber": "(967) 317-9075 x18320",
      "email": "cornelia.doyle@hotmail.com",
      "address": {
        "id": 2,
        "address": "8010 Dannielle Springs",
        "city": "New Brianaburgh",
        "state": "Michigan",
        "zip": "55031"
      }
    }
  ],
  "pageable": {
    "pageNumber": 0,
    "pageSize": 2,
    "sort": {
      "sorted": false,
      "empty": true,
      "unsorted": true
    },
    "offset": 0,
    "paged": true,
    "unpaged": false
  },
  "last": false,
  "totalPages": 50,
  "totalElements": 100,
  "first": true,
  "size": 2,
  "number": 0,
  "sort": {
    "sorted": false,
    "empty": true,
    "unsorted": true
  },
  "numberOfElements": 2,
  "empty": false
}

About

It's simple demo show how to work with pagination in Spring Data JPA.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages