{"id":1908,"date":"2021-10-25T15:22:33","date_gmt":"2021-10-25T06:22:33","guid":{"rendered":"https:\/\/www.itchefblog.com\/?p=1908"},"modified":"2021-10-25T15:22:33","modified_gmt":"2021-10-25T06:22:33","slug":"springboot-pageable%eb%a1%9c-%ed%8e%98%ec%9d%b4%ec%a7%95-%ea%b5%ac%ed%98%84%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/www.itchefblog.com\/?p=1908","title":{"rendered":"SpringBoot Pageable\ub85c \ud398\uc774\uc9d5 \uad6c\ud604\ud558\uae30"},"content":{"rendered":"\n<p>\ucffc\ub9ac\ub85c \uc9c1\uc811 \ud398\uc774\uc9d5\uc744 \uad6c\ud604\ud558\ub824\uace0 \uc0bd\uc9c8\ud55c \uc6f9\ud504 \ucd08\ucc3d\uae30\uc758 \uae30\uc5b5..<br>\ud504\ub808\uc784\uc6cc\ud06c\uac00 \ud3b8\ub9ac\ud558\uac8c \ucc98\ub9ac\ud574\uc8fc\ub2c8 \ub108\ubb34 \ud3b8\ud574\uc84c\ub2e4.<br>Spring Boot\uc5d0\uc11c\ub3c4 \uac04\ud3b8\ud558\uac8c \ucc98\ub9ac\uac00 \uac00\ub2a5\ud558\uc5ec \uc544\uc8fc \uac04\ub2e8\ud788 \ub044\uc801\uc5ec\ubcf8\ub2e4.<\/p>\n\n\n\n<p>\uc0ac\uc6a9\ubc95\uc740 \ub9e4\uc6b0 \uac04\ub2e8\ud55c\ub370, findAll\uc758 \ud30c\ub77c\ubbf8\ud130\ub85c Pageable \ud639\uc740 Pageable\uc758 \uad6c\ud604\uccb4\uc778 PageRequest\ub97c \ub118\uaca8\uc8fc\uba74 \ub41c\ub2e4.<\/p>\n\n\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfun findAll(pageable: Pageable): List&lt;Entity&gt;\n<\/pre>\n\n\n<p>Controller\uc5d0\uc11c \uc544\ub798\uc640 \uac19\uc774 pageable\ub85c \ubc1b\uc544\uc8fc\uba74 @PathVariable\ub85c page, size, sort, direction  \ub4f1\uc744 \ubcc4\ub3c4\ub85c \ucc98\ub9ac\ud558\uc9c0 \uc54a\uc544\ub3c4 \uc54c\uc544\uc11c \ucc98\ub9ac\ud574\uc900\ub2e4.<br>@PageableDefault \ub97c \uc0ac\uc6a9\ud558\uba74 pageable\uc774 \uc804\ub2ec\ub418\uc9c0 \uc54a\uc558\uc744 \ub54c\uc758 default \uac12\ub3c4 \uc138\ud305 \uac00\ub2a5\ud558\ub2e4.<\/p>\n\n\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n@GetMapping(&quot;\/list&quot;)\nfun findAllData(\n    @PageableDefault(page = 0, size = 1, sort = arrayOf(&quot;no&quot;), direction = Sort.direction.DESC) pageable: Pageable)\n<\/pre>\n\n\n<p>return data \ub294 List \ud615\ud0dc\uc758 content\uac00 \uc788\uace0, empty (boolean), first (boolean), last (boolean), number (Int), numberOfElements (Int), pageable (Pageable), size (Int), totalElements (Int), totalPages (Int) \ub4f1\uc758 \ub9ac\ud134\uac12\uc774 \ub118\uc5b4\uc628\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ucffc\ub9ac\ub85c \uc9c1\uc811 \ud398\uc774\uc9d5\uc744 \uad6c\ud604\ud558\ub824\uace0 \uc0bd\uc9c8\ud55c \uc6f9\ud504 \ucd08\ucc3d\uae30\uc758 \uae30\uc5b5..\ud504\ub808\uc784\uc6cc\ud06c\uac00 \ud3b8\ub9ac\ud558\uac8c \ucc98\ub9ac\ud574\uc8fc\ub2c8 \ub108\ubb34 \ud3b8\ud574\uc84c\ub2e4.Spring Boot\uc5d0\uc11c\ub3c4 \uac04\ud3b8\ud558\uac8c \ucc98\ub9ac\uac00 \uac00\ub2a5\ud558\uc5ec \uc544\uc8fc \uac04\ub2e8\ud788 \ub044\uc801\uc5ec\ubcf8\ub2e4. \uc0ac\uc6a9\ubc95\uc740 \ub9e4\uc6b0 \uac04\ub2e8\ud55c\ub370, findAll\uc758 \ud30c\ub77c\ubbf8\ud130\ub85c Pageable \ud639\uc740 Pageable\uc758 \uad6c\ud604\uccb4\uc778 PageRequest\ub97c \ub118\uaca8\uc8fc\uba74 \ub41c\ub2e4. Controller\uc5d0\uc11c \uc544\ub798\uc640 \uac19\uc774 pageable\ub85c \ubc1b\uc544\uc8fc\uba74 @PathVariable\ub85c page, size, sort, direction \ub4f1\uc744 \ubcc4\ub3c4\ub85c \ucc98\ub9ac\ud558\uc9c0 \uc54a\uc544\ub3c4 \uc54c\uc544\uc11c \ucc98\ub9ac\ud574\uc900\ub2e4.@PageableDefault \ub97c \uc0ac\uc6a9\ud558\uba74 pageable\uc774 \uc804\ub2ec\ub418\uc9c0 \uc54a\uc558\uc744 \ub54c\uc758 default \uac12\ub3c4 &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[556,596,606,660,661,662,663,664,665],"_links":{"self":[{"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1908"}],"collection":[{"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1908"}],"version-history":[{"count":1,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1908\/revisions"}],"predecessor-version":[{"id":1909,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1908\/revisions\/1909"}],"wp:attachment":[{"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1908"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1908"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itchefblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}