Fixed
Details
Assignee
Steve EbersoleSteve EbersoleReporter
Josh LandinJosh LandinFix versions
Priority
Major
Details
Details
Assignee
Steve Ebersole
Steve EbersoleReporter
Josh Landin
Josh LandinFix versions
Priority
Created November 28, 2016 at 11:00 PM
Updated February 24, 2021 at 4:39 PM
Resolved February 24, 2021 at 4:39 PM
As originally discussed here:
https://forum.hibernate.org/viewtopic.php?f=1&t=1041975
I'm encountering an issue with changes made in 4.3.5.Final (and 4.2.12.Final) via https://hibernate.atlassian.net/browse/HHH-9071#icft=HHH-9071 related to Proxy narrowing. A test case is attached which demonstrates the following behavior:
Given a model where:
#a class hierarchy where User is a parent class of AdvancedUser
#a class UserConfig with a many-to-one to User
When executing a query for a specific UserConfig, the getUser() returns a proxy of User.class. However, immediately executing a second (polymorphic) query for that same user directly, fails to return the AdvancedUser instance.
This works fine in 4.3.4.Final (and 4.2.11.Final). That is, this same code returns the proper AdvancedUser instance from the second query.