-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[ming] Chapter10_API & Pagin
- Loading branch information
Showing
5 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## Spring Data JPA의 Paging | ||
- PageRequest 객체로 페이징 처리를 하고, 리턴타입으로 Page와 Slice를 사용한다. | ||
### Page | ||
- Page<T> | ||
- Page 인터페이스는 Slice 인터페이스를 상속한다. → getTotalPages(), getTotalElements() 메서드를 추가로 갖고 있다. | ||
- Slice와 다르게 전체 페이지 수와 전체 데이터 수를 조회활 수 있다. | ||
- 전체 페이지 수 및 전체 데이터 수를 조회하기 위한 count 쿼리를 추가적으로 호출한다. | ||
### Slice | ||
- Slice<T> | ||
- Slice가 있는지만 판단한다. | ||
- 무한 스크롤 방식을 사용하는 경우, 페이지 수와 데이터 수가 필요 없기 때문에 Slice를 사용하는 것이 유용하다. | ||
|
||
## 객체 그래프 탐색 | ||
- 객체 그래프 탐색: . 을 찍어서 연관된 객체를 탐색하는 것 | ||
- 객체는 객체 그래프로 연관된 그래프를 탐색할 수 있어야 한다. | ||
- SQL로 직접 데이터를 다루면 SQL에 따라 탐색할 수 있는 범위가 정해지는 제약이 생긴다. | ||
- SQL문에서 B, C만 사용하면 그래프의 범위를 정해져서 B, C 외에는 탐색, 참조할 수 없다. | ||
- 지연 로딩: JPA는 연관된 객체를 사용하는 시점에 적절한 SELECT SQL문을 수행한다. 실제 객체를 사용하는 시점까지 데이터베이스 조회를 미룬다. | ||
|
||
## JPQL | ||
- 엔티티 객체를 조회하는 객체지향 쿼리 | ||
- SQL을 추상화하여 특정 DB에 의존하지 않는다. | ||
- SQL이 테이블을 대상으로 한 쿼리 언어라면 JPQL은 엔티티 객체를 대상으로 한 쿼리 언어 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## 10주차 미션 인증 | ||
|
||
Github: https://github.com/qzzloz/SSUMC6th-spring-practice/tree/week10 | ||
|
||
### 내가 작성한 리뷰 목록 | ||
Github: https://github.com/qzzloz/SSUMC6th-spring-practice/pull/14 | ||
 | ||
|
||
### 특정 가게의 미션 목록 | ||
Github: https://github.com/qzzloz/SSUMC6th-spring-practice/pull/12 | ||
 | ||
|
||
### 내가 진행중인 미션 목록 | ||
Github: https://github.com/qzzloz/SSUMC6th-spring-practice/pull/16 | ||
 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.