Skip to:
Having two unrelated entities:
And the Property:
Property
We are trying to get both Entities, but left join only the Entities that have a specific Property:
So we are interested only in the Entity2 that have a Property named admin. This is just an example, our actual use case is more complicated.
admin
This was working fine before Hibernate 6, generating the following query:
But with Hibernate 6, another join is added at the end which duplicates the results and breaks the left join:
Join that has no purpose:
Created test cases for both Hibernate 5 and 6:
Having two unrelated entities:
And the
Property
:We are trying to get both Entities, but left join only the Entities that have a specific Property:
So we are interested only in the Entity2 that have a Property named
admin
. This is just an example, our actual use case is more complicated.This was working fine before Hibernate 6, generating the following query:
But with Hibernate 6, another join is added at the end which duplicates the results and breaks the left join:
Join that has no purpose:
Created test cases for both Hibernate 5 and 6: