Nested subtypes filtered out in bidirectional OneToMany association load
Description
Attachments
2
causes
is a fix for
Activity
Show:

Guillaume ToisonNovember 29, 2023 at 12:59 PM
Pull request reproducing the problem:
Fixed
Details
Assignee
Marco BelladelliMarco BelladelliReporter
Guillaume ToisonGuillaume ToisonComponents
Sprint
NoneFix versions
Priority
Major
Details
Details
Assignee
Reporter

Components
Sprint
None
Fix versions
Priority
Created November 29, 2023 at 11:44 AM
Updated January 25, 2024 at 12:51 PM
Resolved January 8, 2024 at 3:12 PM
Hello, I’m trying to migrate an application from Hibernate 5.5.8 to 6.4.0
Please consider the following abridged model:
When trying to load the
refrigerator.cheeses
collection, Hibernate now generates the following SQL query:I think that Hibernate shouldn’t be filtering
t.type='Cheese'
but rather something liket.type in ('Cheese', 'SoftCheese')
In the end the collection only contains the entities of the actual type
Cheese
I will submit a PR with a test case reproducing the problem