종우의 컴퓨터 공간
Querydsl 개념과 신텍스 본문
규모가 있는 프로젝트에서의 데이터 조회는 FK의 조인, 복잡한 조건 등으로 인해 이런 Entity 클래스만으로 처리하기 어려워 조회용 프레임워크를 추가로 사용한다. 대표적인 예로, querydsl, jooq, MyBatis 등이 있다. 조회는 위 세가지 프레임워크 중 하나를 통해 조회하고, 등록/수정/삭제 등은 SpringDataJpa를 통해 진행한다.
Querydsl을 추천하는 세가지 이유?
- 타입 안정성이 보장된다.
- 국내 많은 회사가 사용중이다.
- 래퍼런스가 많다.
@Query("SELECT p FROM Posts p ORDER BY p.id DESC"); SQL ORDER BY keyword
- The ORDER BY keyword is used to sort the result-set in ascending or descending order
- The ORDER BY keyword sorts the records in ascending order by default. To sort the records in descending order, use the DESC keyword.
- Syntax: SELECT column1, column2, ... FROM table_name ORDER BY column1, column2, ... ASC|DESC;
'스프링 부트 (SpringBoot)' 카테고리의 다른 글
Optional in Java (0) | 2021.07.15 |
---|---|
Stream in Java (0) | 2021.07.14 |
머스테치(Mustache) 신텍스 (0) | 2021.07.13 |
제이쿼리(jQuery) js 신텍스 (0) | 2021.07.13 |
부트 스트랩(Boot Strap)과 제이쿼리(jQuery) 개념 (0) | 2021.07.13 |