摘要:1.查询@Query(“selectsfromStoresjoinfetchs.productswheres.user.id=:user_id”)2.@EntityGraph(attributePaths={“产品”})3.@NamedEntityGraphs({@NamedEntityGraph(name=“allJoinsButMessages”,attributeNod
1. Query方式
@Query("select s from Store s join fetch s.products where s.user.id = :user_id")
2.@EntityGraph(attributePaths = { "products" })
3. @NamedEntityGraphs({
@NamedEntityGraph(name="allJoinsButMessages",attributeNodes ={@NamedAttributeNode("customer"),@NamedAttributeNode("handling_employee"),@NamedAttributeNode("genre")}),@NamedEntityGraph(name="allJoins",attributeNodes ={@NamedAttributeNode("customer"),@NamedAttributeNode("handling_employee"),@NamedAttributeNode("genre"),@NamedAttributeNode("complaintMessages")}),@NamedEntityGraph(name="noJoins",attributeNodes ={
})})