일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 그리디
- pointcut
- 알고리즘
- http
- kotlin
- 스프링 핵심 기능
- JPQL
- 김영한
- Servlet
- AOP
- QueryDSL
- Thymeleaf
- 자바
- Android
- springdatajpa
- JDBC
- SpringBoot
- java
- Exception
- 스프링 핵심 원리
- 스프링
- 백준
- Greedy
- Spring Boot
- spring
- 인프런
- jpa
- db
- Proxy
- transaction
- Today
- Total
목록pageable (4)
개발자되기 프로젝트
1. Controller개발 @GetMapping("/v2/members") public Page searchMemberV2(@ModelAttribute MemberSearchCondition condition, Pageable pageable){ return memberRepository.searchPageSimple(condition, pageable); } @GetMapping("/v3/members") public Page searchMemberV3(@ModelAttribute MemberSearchCondition condition, Pageable pageable){ return memberRepository.searchPageComplex(condition, pageable); } Query..
1. SpringData Paging 활용 스프링 데이터의 Page, Pageable을 활용해보자. 전체 카운트를 한번에 조회하는 단순한 방법 데이터 내용과 전체 카운트를 별도로 조회하는 방법 2. 인터페이스에 두 가지 기능 추가 public interface MemberRepositoryCustom { List search(MemberSearchCondition condition); Page searchPageSimple(MemberSearchCondition condition, Pageable pageable); Page searchPageComplex(MemberSearchCondition condition, Pageable pageable); } 3. 전체 카운트를 한번에 조회하는 단순한 방법 s..
1. 도메인 클래스 컨버터 HTTP 파라미터로 넘어온 엔티티의 아이디로 엔티티 객체를 찾아서 바인딩해줌 쉽게말해 @Pathvariable로 id를 받으면 스프링이 id를 가지고 엔티티를 바인딩함. findMember : id를 파라미터로 받아 직접 member를 찾아옴. fimdMember2 : id를 파라미터로 받으면 스프링이 member와 바인딩함. @GetMapping("/members/{id}") public String findMember(@PathVariable("id") Long id){ Member member = memberRepository.findById(id).get(); return member.getUserName(); } @GetMapping("/members2/{id}") p..
1. SpringDataJpa 스프링에서 페이징 기능을 표준화 시켰다 ㄷㄷㄷ 2. 페이징, 정렬 파라미터 org.springframework.data.domain.Sort : 정렬 기능 org.springframework.data.domain.Pageable : 페이징 기능 (내부에 Sort 포함) data.jpa가 아니다 즉, DB에 관계없이 적용이 가능한다. 3. 특별한 반환 타입 org.springframework.data.domain.Page : 추가 count 쿼리 결과를 포함하는 페이징 TotalCount 가져오는 쿼리는 자동으로 날라감. org.springframework.data.domain.Slice : 추가 count 쿼리 없이 다음 페이지만 확인 가능 (내부적으로 limit + 1조회..