page

    Spring Data JPA의 Page와 Slice

    Spring Data JPA의 Page와 Slice

    Sping Data JPA는 간단한 페이징 처리를 지원한다. 페이징을 처리를 하기 위해선 한 페이지 당 보여줄 데이터의 개수와 몇 번째 페이지인지에 대한 정보가 필요하다. @GetMapping public ResponseEntity searchPointDetail(@RequestParam(name = "page") int page, @RequestParam(name = "size") int size) { // 로직 } Spring Data JPA는 이러한 정보를 Pageable 객체를 이용하고, Pageable 객체를 JpaRepository에 전달하여 페이징 처리를 지원한다. @Repository public interface PointRepository extends JpaRepository { Pa..