본문 바로가기

du.study기록공간

검색하기
du.study기록공간
프로필사진 du.study

  • 분류 전체보기 (70)
    • 자바 (23)
    • 스프링 (31)
    • Tool (2)
    • presto (1)
    • DB (3)
    • JPA (5)
    • nginx (1)
    • kotlin (2)
    • 기타 잡다한 지식 (2)
Guestbook
Notice
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags
  • awssecretsmanagerpropertysources
  • aws secretmanager
  • EnableWebMvc
  • DeferredImportSelector
  • map
  • Spring Boot
  • @FunctionalInterface
  • asyncconfigurer
  • spring MVC
  • wire type
  • grpc
  • java list
  • CompletableFuture
  • java.util.list
  • traceasynccustomautoconfiguration
  • HashMap
  • jpa
  • asynccustomautoconfiguration
  • java lambda
  • kotlin
  • traceId
  • java
  • ResponseBody
  • micrometer tracing
  • elasticsearch
  • Sleuth
  • SpringMVC
  • list
  • Spring JPA
  • spring
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록jpa Pageable (1)

du.study기록공간

JPA - Pageable을 이용한 Limit설정 방법

이전에도 간단하게 다룬적이 있지만 따로 기록을 위하여 다시 작성하려합니다. JPA서 limit사용하고 싶은 경우에 Pageable를 사용하게 됩니다. 우선 데이터와 repository는 다음과 같습니다. (mysql) (repository) public interface AccountRepository extends JpaRepository { List findByIdGreaterThan(Long id, Pageable pageable); } 해당상태에서 조회하는 쿼리는 다음과같이 할 수 있습니다. int batch = 2; long startId = 0; while(true){ List list = accountRepository.findByIdGreaterThan(startId,PageRequest...

JPA 2020. 9. 17. 23:46
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바