I have an entity with a @ManyToOne
relation, which I\'d like to retrieve with a single query, thus using @Fetch(FetchMode.JOIN)
. Sometimes Hibernat
The rule is quite simple: Queries ignore fetch modes. When you write a query, you are telling what is joined and what is not joined.
Fetch mode is only taken into account when entity is loaded with methods like EntityManager.find(class, id)
or when navigating through some other entity graph and loading its associations.