Skip to content

Commit

Permalink
Merge pull request #43 from SSUMC-6th/ming/#31
Browse files Browse the repository at this point in the history
[ming] Chapter10_API & Pagin
  • Loading branch information
qzzloz authored Jun 27, 2024
2 parents 9b31f87 + d0fc88a commit 927be17
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/chapter10/Ch10Keyword.md
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은 엔티티 객체를 대상으로 한 쿼리 언어
15 changes: 15 additions & 0 deletions src/mission/chapter10/Ch10Mission.md
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
![](./image/1.png)

### 특정 가게의 미션 목록
Github: https://github.com/qzzloz/SSUMC6th-spring-practice/pull/12
![](./image/Untitled-3.png)

### 내가 진행중인 미션 목록
Github: https://github.com/qzzloz/SSUMC6th-spring-practice/pull/16
![](./image/Untitled-2.png)
Binary file added src/mission/chapter10/image/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/mission/chapter10/image/Untitled-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/mission/chapter10/image/Untitled-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 927be17

Please sign in to comment.