Notice
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- @FunctionalInterface
- traceId
- SpringMVC
- Spring JPA
- ResponseBody
- java
- wire type
- Sleuth
- spring
- java list
- java lambda
- list
- spring MVC
- micrometer tracing
- elasticsearch
- EnableWebMvc
- java.util.list
- Spring Boot
- jpa
- awssecretsmanagerpropertysources
- DeferredImportSelector
- asynccustomautoconfiguration
- asyncconfigurer
- aws secretmanager
- kotlin
- HashMap
- map
- traceasynccustomautoconfiguration
- grpc
- CompletableFuture
Archives
- Today
- Total
목록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