사용자 도구

사이트 도구


java:querydsl

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
java:querydsl [2018/04/12 08:22]
kwon37xi
java:querydsl [2019/03/30 21:37]
kwon37xi
줄 1: 줄 1:
 ====== QueryDSL ====== ====== QueryDSL ======
   * http://www.querydsl.com/   * http://www.querydsl.com/
-  * [[java:querydsl:nativesql|QueryDSL Native SQL]]+  * [[java:jpa|JPA]] 쿼리를 더 편리하게 생성할 수도 있고 
 +  * [[java:querydsl:nativesql|QueryDSL Native SQL]]로 Native SQL도 생성 가능하다.
   * [[http://www.querydsl.com/static/querydsl/latest/reference/html/|QueryDSL Reference]]   * [[http://www.querydsl.com/static/querydsl/latest/reference/html/|QueryDSL Reference]]
   * Querydsl is a framework which enables the construction of type-safe SQL-like queries for multiple backends including JPA, JDO and SQL in Java.   * Querydsl is a framework which enables the construction of type-safe SQL-like queries for multiple backends including JPA, JDO and SQL in Java.
줄 11: 줄 12:
 ClassPathUtils.scanPackage(Thread.currentThread().getContextClassLoader(), packageToLoad); ClassPathUtils.scanPackage(Thread.currentThread().getContextClassLoader(), packageToLoad);
 </code> </code>
 +
 ===== join 성능 향상 ===== ===== join 성능 향상 =====
   * Join 시 그 결과로 나오는 관계 객체를 Eager Loading 하려면 ''fetch()'' 를 사용해야 한다.   * Join 시 그 결과로 나오는 관계 객체를 Eager Loading 하려면 ''fetch()'' 를 사용해야 한다.
줄 34: 줄 36:
     .where(parent.something.gt(child.somthing))....;     .where(parent.something.gt(child.somthing))....;
 </code> </code>
 +
 +===== JPA Subquery & JPAExpressions =====
 +  * JPA Subquery 는 ''JPAExpressions.select'' 를 이용하여 각종 Sub Query 생성가능.
 +  * SELECT 에서 사용할 때는 ''ExpressionUtils.as([subquery])'' 로 묶어준다.
  
 ===== Native 조건 condition ===== ===== Native 조건 condition =====
줄 78: 줄 84:
 } }
 </code> </code>
 +
 +===== Case/When =====
 +  * [[https://jojoldu.tistory.com/401|[Querydsl] Case When 사용하기]]
 +  * ''CaseBuilder'' 사용.
  
 ===== @Embeddable의 필드 소스 생성 ===== ===== @Embeddable의 필드 소스 생성 =====
java/querydsl.txt · 마지막으로 수정됨: 2023/12/06 13:44 저자 kwon37xi