사용자 도구

사이트 도구


java:querydsl

문서의 이전 판입니다!


QueryDSL

  • Querydsl is a framework which enables the construction of type-safe SQL-like queries for multiple backends including JPA, JDO and SQL in Java.

JPA QueryDSL Cross Join 발생

  • Parent - Child가 1:1 관계일 때 다음과 같이 쿼리했더니 inner join과 cross join이 함께 발생했다.
    QParent parent = QParent.parent;
    QChild child = parent.child;
     
    from(parent).innerJoin(parent.child).fetch()
        .where(parent.something.gt(parent.child.somthing))....;
  • 다음처럼 innerJoin에 PATH를 지정했더니 cross join이 사라졌다.
    QParent parent = QParent.parent;
    QChild child = QChild.child; // 여기 달라짐
     
    from(parent).innerJoin(parent.child, child).fetch()
        .where(parent.something.gt(child.somthing))....;

참고

java/querydsl.1413022270.txt.gz · 마지막으로 수정됨: 2014/10/11 19:11 저자 kwon37xi