Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JPA entity graph: which join types?

JPA entity graph: e.g.

Order - OrderItem - Product

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

Why there is no joinType for order -> orderItems and orderItem -> product? All the joins in an entity graph are supposed to be LEFT joins?

like image 286
eastwater Avatar asked Oct 19 '25 10:10

eastwater


1 Answers

The purpose of an EntityGraph is to define what to include in the result graph.

That does not affect the join type. So your dependencies are loaded the same way as they are loaded without EntityGraph.

like image 152
Simon Martinelli Avatar answered Oct 22 '25 04:10

Simon Martinelli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!