We have recently upgraded from Hibernate 5 to Hibernate 6, and we have noticed performance degradation on many of our queries. In some of the cases we could match the performance to that of Hibernate 5, by adding
@Fetch(FetchMode.SELECT) to some of the entity relationships. But the code base is rather large and we are not sure of the side effects if we blindly add them to every entity. My questions are:
Do you know if the default in Hibernate 5 was
@Fetch(FetchMode.SELECT)and changed in Hibernate 6?
Is there a way we can set the default globally to
@Fetch(FetchMode.SELECT)so that we don’t have to add them on every single relationship?
Is there any other setting we can try to make the number of joins in the generated queries match that of Hibernate 5?
BTW, the version we are using is 6.1.6.Final.
Many thanks in advance.