{"id":7873,"date":"2013-01-31T10:00:15","date_gmt":"2013-01-31T08:00:15","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=7873"},"modified":"2013-01-30T21:46:13","modified_gmt":"2013-01-30T19:46:13","slug":"spring-data-jpa-and-pagination","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html","title":{"rendered":"Spring Data JPA and pagination"},"content":{"rendered":"<p>Let us start with the classic JPA way to support pagination. Consider a simple domain class &#8211; A &#8216;Member&#8217; with attributes first name, last name. To support pagination on a list of members, the JPA way is to support a finder which takes in the offset of the first result(firstResult) and the size of the result(maxResults) to retrieve, this way:<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<pre class=\" brush:java\">import java.util.List;\r\n\r\nimport javax.persistence.TypedQuery;\r\n\r\nimport org.springframework.stereotype.Repository;\r\n\r\nimport mvcsample.domain.Member;\r\n\r\n@Repository\r\npublic class JpaMemberDao extends JpaDao&lt;Long, Member&gt; implements MemberDao{\r\n\r\n public JpaMemberDao(){\r\n  super(Member.class);\r\n }\r\n @Override\r\n public List&lt;Member&gt; findAll(int firstResult, int maxResults) {\r\n  TypedQuery&lt;Member&gt; query = this.entityManager.createQuery('select m from Member m', Member.class);\r\n  return query.setFirstResult(firstResult).setMaxResults(maxResults).getResultList();\r\n }\r\n\r\n @Override\r\n public Long countMembers() {\r\n  TypedQuery&lt;Long&gt; query = this.entityManager.createQuery('select count(m) from Member m', Long.class);\r\n  return query.getSingleResult();\r\n }\r\n}<\/pre>\n<p>An additional API which returns the count of the records is needed to determine the number of pages for the list of entity, as shown above. Given this API, two parameters are typically required from the UI:<\/p>\n<ul>\n<li>the current page being displayed (say &#8216;page.page&#8217;)<\/li>\n<li>the size of list per page (say &#8216;page.size&#8217;)<\/li>\n<\/ul>\n<p>The controller will be responsible for transforming these inputs to the one required by the JPA &#8211; firstResult and maxResults this way:<\/p>\n<pre class=\" brush:java\">@RequestMapping(produces='text\/html')\r\npublic String list(@RequestParam(defaultValue='1', value='page.page', required=false) Integer page, \r\n   @RequestParam(defaultValue='10', value='page.size', required=false) Integer size, Model model){\r\n int firstResult = (page==null)?0:(page-1) * size;\r\n model.addAttribute('members',this.memberDao.findAll(firstResult, size));\r\n float nrOfPages = (float)this.memberDao.countMembers()\/size;\r\n int maxPages = (int)( ((nrOfPages&gt;(int)nrOfPages) || nrOfPages==0.0)?nrOfPages+1:nrOfPages);\r\n model.addAttribute('maxPages', maxPages);\r\n return 'members\/list';\r\n}<\/pre>\n<p>Given a list as a model attribute and the count of all pages(maxPages above), the list can be transformed to a simple table in a jsp, there is a nice tag library that is packaged with Spring Roo which can be used to present the pagination element in a jsp page, I have included it with the reference.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/01\/MemberList.png\"><img decoding=\"async\" class=\"aligncenter\" style=\"border: 0px none;\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2013\/01\/MemberList.png\" alt=\"\" width=\"640\" height=\"268\" border=\"0\" \/><\/a><\/p>\n<p> So this is the approach to pagination using JPA and Spring MVC. <strong><a href=\"http:\/\/www.springsource.org\/spring-data\/jpa\">Spring-Data-JPA<\/a> makes this even simpler<\/strong>, first is the repository interface to support retrieving a paginated list &#8211; in its simplest form the repository simply requires extending Spring-Data-JPA interfaces and at runtime generates the proxies which implements the real JPA calls:<\/p>\n<pre class=\" brush:java\">import mvcsample.domain.Member;\r\n\r\nimport org.springframework.data.jpa.repository.JpaRepository;\r\nimport org.springframework.stereotype.Repository;\r\n\r\npublic interface MemberRepository extends JpaRepository&lt;Member, Long&gt;{\r\n \/\/\r\n}<\/pre>\n<p>Given this, the controller method which accesses the repository interface is also very simple:<\/p>\n<pre class=\" brush:java\">@RequestMapping(produces='text\/html')\r\npublic String list(Pageable pageable, Model model){\r\n Page&lt;Member&gt; members = this.memberRepository.findAll(pageable);\r\n    model.addAttribute('members', members.getContent());\r\n    float nrOfPages = members.getTotalPages();\r\n    model.addAttribute('maxPages', nrOfPages);\r\n return 'members\/list';\r\n}<\/pre>\n<p>The controller method accepts a parameter called Pageable, this parameter is populated using a Spring MVC<a href=\"http:\/\/static.springsource.org\/spring\/docs\/3.2.x\/javadoc-api\/org\/springframework\/web\/method\/support\/HandlerMethodArgumentResolver.html\"> HandlerMethodArgumentResolver<\/a> that looks for request parameters by name &#8216;page.page&#8217; and &#8216;page.size&#8217; and converts them into the Pageable argument. This custom HandlerMethodArgumentResolver is registered with Spring MVC this way:<\/p>\n<pre class=\" brush:xml\">&lt;mvc:annotation-driven&gt;\r\n &lt;mvc:argument-resolvers&gt;\r\n  &lt;bean class='org.springframework.data.web.PageableArgumentResolver'&gt;&lt;\/bean&gt;\r\n &lt;\/mvc:argument-resolvers&gt;\r\n&lt;\/mvc:annotation-driven&gt;<\/pre>\n<p>the JpaRepository API takes in the pageable argument and returns a page, internally automatically populating the count of pages also which can retrieved from the Page methods. If the queries need to be explicitly specified then this can be done in a number of ways, one of which is the following:<\/p>\n<pre class=\" brush:java\">@Query(value='select m from Member m', countQuery='select count(m) from Member m')\r\nPage&lt;Member&gt; findMembers(Pageable pageable);<\/pre>\n<p>One catch which I could see is that that pageable&#8217;s page number is 0 indexed, whereas the one passed from the UI is 1 indexed, however the PageableArgumentResolver internally handles and converts the 1 indexed UI page parameter to the required 0 indexed value. Spring Data JPA thus makes it really simple to implement a paginated list page. I am including a sample project which ties all this together, along with the pagination tag library which makes it simple to show the paginated list.<\/p>\n<h4>Resources:<\/h4>\n<ul>\n<li>A sample projects which implements a paginated list is available<a href=\"https:\/\/github.com\/bijukunjummen\/spring-mvc-test-sample.git\"> here<\/a> : https:\/\/github.com\/bijukunjummen\/spring-mvc-test-sample.git<\/li>\n<li><a href=\"http:\/\/static.springsource.org\/spring-data\/data-jpa\/docs\/current\/reference\/html\/\">Spring-Data-JPA reference<\/a>: http:\/\/static.springsource.org\/spring-data\/data-jpa\/docs\/current\/reference\/html\/<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong><em>Reference: <\/em><\/strong><a href=\"http:\/\/www.java-allandsundry.com\/2012\/12\/spring-data-jpa-and-pagination.html\">Spring Data JPA and pagination<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Biju Kunjummen at the <a href=\"http:\/\/www.java-allandsundry.com\/\">all and sundry<\/a> blog.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let us start with the classic JPA way to support pagination. Consider a simple domain class &#8211; A &#8216;Member&#8217; with attributes first name, last name. To support pagination on a list of members, the JPA way is to support a finder which takes in the offset of the first result(firstResult) and the size of the &hellip;<\/p>\n","protected":false},"author":236,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[33,30,321],"class_list":["post-7873","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-jpa","tag-spring","tag-spring-data"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Spring Data JPA and pagination<\/title>\n<meta name=\"description\" content=\"Let us start with the classic JPA way to support pagination. Consider a simple domain class - A &#039;Member&#039; with attributes first name, last name. To support\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring Data JPA and pagination\" \/>\n<meta property=\"og:description\" content=\"Let us start with the classic JPA way to support pagination. Consider a simple domain class - A &#039;Member&#039; with attributes first name, last name. To support\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-01-31T08:00:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Biju Kunjummen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Biju Kunjummen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/spring-data-jpa-and-pagination.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/spring-data-jpa-and-pagination.html\"},\"author\":{\"name\":\"Biju Kunjummen\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/802eedfe6f17c3c13fa656af46b6b0e5\"},\"headline\":\"Spring Data JPA and pagination\",\"datePublished\":\"2013-01-31T08:00:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/spring-data-jpa-and-pagination.html\"},\"wordCount\":502,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/spring-data-jpa-and-pagination.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"JPA\",\"Spring\",\"Spring Data\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/spring-data-jpa-and-pagination.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/spring-data-jpa-and-pagination.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/spring-data-jpa-and-pagination.html\",\"name\":\"Spring Data JPA and pagination\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/spring-data-jpa-and-pagination.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/spring-data-jpa-and-pagination.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2013-01-31T08:00:15+00:00\",\"description\":\"Let us start with the classic JPA way to support pagination. Consider a simple domain class - A 'Member' with attributes first name, last name. To support\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/spring-data-jpa-and-pagination.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/spring-data-jpa-and-pagination.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/spring-data-jpa-and-pagination.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"spring-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/01\\\/spring-data-jpa-and-pagination.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Spring Data JPA and pagination\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/802eedfe6f17c3c13fa656af46b6b0e5\",\"name\":\"Biju Kunjummen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g\",\"caption\":\"Biju Kunjummen\"},\"sameAs\":[\"http:\\\/\\\/biju-allandsundry.blogspot.com\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Biju-Kunjummen\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring Data JPA and pagination","description":"Let us start with the classic JPA way to support pagination. Consider a simple domain class - A 'Member' with attributes first name, last name. To support","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html","og_locale":"en_US","og_type":"article","og_title":"Spring Data JPA and pagination","og_description":"Let us start with the classic JPA way to support pagination. Consider a simple domain class - A 'Member' with attributes first name, last name. To support","og_url":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-01-31T08:00:15+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Biju Kunjummen","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Biju Kunjummen","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html"},"author":{"name":"Biju Kunjummen","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/802eedfe6f17c3c13fa656af46b6b0e5"},"headline":"Spring Data JPA and pagination","datePublished":"2013-01-31T08:00:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html"},"wordCount":502,"commentCount":3,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["JPA","Spring","Spring Data"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html","url":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html","name":"Spring Data JPA and pagination","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2013-01-31T08:00:15+00:00","description":"Let us start with the classic JPA way to support pagination. Consider a simple domain class - A 'Member' with attributes first name, last name. To support","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","width":150,"height":150,"caption":"spring-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/01\/spring-data-jpa-and-pagination.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Spring Data JPA and pagination"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/802eedfe6f17c3c13fa656af46b6b0e5","name":"Biju Kunjummen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g","caption":"Biju Kunjummen"},"sameAs":["http:\/\/biju-allandsundry.blogspot.com"],"url":"https:\/\/www.javacodegeeks.com\/author\/Biju-Kunjummen"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/7873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/236"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=7873"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/7873\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=7873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=7873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=7873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}