Turns out that’s expected, and the model is to blame: https://hibernate.zulipchat.com/#narrow/stream/132094-hibernate-orm-dev/topic/max_fetch_depth/near/338543962
Hi @Yoann Rodiere , looking at https://hibernate.atlassian.net/browse/HHH-16219 , the test you provided assumes that when you call entityB.getEntityA1() only entityA1 is initialized but this is not correct, the call trigger also the initialization of entityA2 so the different number of joins (to avoid this entityA2 has to be annotated with @LazyGroup ). The difference with Hibernate 5 is that now we execute only 1 queries to initialize both entitA1 and entityA2 while in 5 we execute 2 queries one for each association.
|