2017-11-24 4 views
0

JPA 엔티티 그래프 : 예 :JPA 엔티티 그래프 : 어떤 유형을 결합합니까?

주문 - OrderItem에 - 제품 order -> orderItems and orderItem -> product에 대한 joinType이없는 이유

@NamedEntityGraph(name = "order", 
    attributeNodes = @NamedAttributeNode(value = "orderItems", subgraph = "orderItems"), 
    subgraphs = @NamedSubgraph(name = "orderItems", attributeNodes = @NamedAttributeNode("product"))) 

은? 엔티티 그래프의 모든 조인은 LEFT 조인으로 간주됩니까?

답변

0

EntityGraph의 목적은 결과 그래프에 포함 할 것을 정의하는 것입니다.

조인 유형에는 영향을주지 않습니다. 따라서 종속성은 EntityGraph없이로드되는 것과 같은 방식으로로드됩니다.

+0

CriteriaQuery는 조인 유형을 지정할 수 있습니다. 그러나 entityGraph와 함께 find() 메소드를 사용하고 조인과 함께 하나의 SQL을 사용하여 entityGraph의 모든 엔티티를로드하려면 조인 유형이 필요합니다. 이 경우 조인 유형을 지정할 방법이 없습니다. – Sunnyday