I use hibernate 4.3.6, spring data jpa 1.9
I have 2 entity: DocumentOrder and OrderChain. OrderChain have ManyToOne DocumentOrders; DocumentOrder doesnt have link.
public class OrderChain {
@ManyToOne(fetch = FetchType.EAGER)
private DocumentOrder documentOrder;
}
When i do query "SELECT oc FROM OrderChain oc WHERE ..." i have many requests to database(I look in console).
I find similar topics:
FetchMode join makes no difference for ManyToMany relations in spring JPA repositories
but i dont know how solve it without adding join fetch in my Query.
edit: I try add @Fetch(FetchMode.JOIN)
to documentOrder, but it doesnt make any effect.
Thanks