일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Android
- 스프링 핵심 원리
- 백준
- Servlet
- Greedy
- spring
- java
- pointcut
- springdatajpa
- Thymeleaf
- 김영한
- 인프런
- 그리디
- QueryDSL
- SpringBoot
- Spring Boot
- AOP
- kotlin
- transaction
- 스프링
- Exception
- db
- 알고리즘
- http
- JPQL
- 자바
- JDBC
- jpa
- 스프링 핵심 기능
- Proxy
- Today
- Total
목록fetchREsults (3)
개발자되기 프로젝트
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. 예제 offset : 몇 개 건너뒴? limit : 몇 개 씩? @Test public void paging1(){ List result = queryFactory .selectFrom(member) .orderBy(member.username.desc()) .offset(1) .limit(2) //2개씩 .fetch(); assertThat(result.size()).isEqualTo(2); } fetchResults()를 통해 페이징 정보 포함. @Test public void paging2(){ QueryResults queryResults = queryFactory .selectFrom(member) .orderBy(member.username.desc()) .offset(1) .limit(..
1. query 결과 조회 방법 fetch의 사전적 의미 : 가져오다. fetch() : 리스트 조회, 데이터 없으면 빈 리스트 반환 fetchOne() : 단 건 조회 결과가 없으면 : null 결과가 둘 이상이면 : com.querydsl.core.NonUniqueResultException fetchFirst() : limit(1).fetchOne() fetchResults() : 페이징 정보 포함, total count 쿼리 추가 실행 fetchCount() : count 쿼리로 변경해서 count 수 조회 2. 예제 fetchResults()의 경우 getResults()를 통해 contents를 꺼낼 수 있음. @Test public void resultFetch(){ List fetch = ..