Join Types have to be specified in JPQL queries or criteria queries while creating joins .
For example below query will result in inner join between three tables .
select o from Order o join fetch o.orderItems items join fetch items.product p
And
Below query will result in left outer join between three tables
:
select o from Order o left join o.orderItems items left join items.product p
But if you will execute above queries directly hibernate will return cross join of all the three tables .
**Hence to get the retro fitted(all relationships initialised properly ) entities you will have to pass the entity graph as hint to query .Entity graph will not change the join type you have specified in query or Criteria query. It will just indicate hibernate to fetch the relationships eagerly and retro fit them in entities properly .
**
Check my github link :
https://github.com/vaneetkataria/Jpa-Hibernate/blob/master/jdbcToJpaMigration/src/test/java/com/katariasoft/technologies/jpaHibernate/entity/fetch/joinfetch/JPQLEntityGraphsJoinFetchTests.java