Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiOGY4NGM0YWRm...
) / Improvement (
https://hibernate.atlassian.net/browse/HHH-16571?atlOrigin=eyJpIjoiOGY4NG...
) HHH-16571 (
https://hibernate.atlassian.net/browse/HHH-16571?atlOrigin=eyJpIjoiOGY4NG...
) Avoid root table join for FK access of key-many-to-one (
https://hibernate.atlassian.net/browse/HHH-16571?atlOrigin=eyJpIjoiOGY4NG...
)
Issue Type: Improvement Affects Versions: 6.2.2 Assignee: Unassigned Components:
hibernate-core Created: 08/May/2023 10:00 AM Priority: Major Reporter: Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
An entity model with a key-many-to-one that uses joined inheritance always has to join the
root table when querying a subclass, even if no attributes of the super types are used.
This is unfortunately because the FK of the ToOneAttributeMapping uses the root table
information for the mapping.
We should try to optimize this in
org.hibernate.metamodel.mapping.internal.MappingModelCreationHelper#interpretToOneKeyDescriptor
to be able to avoid always joining.
Note that there is code which build on the current behavior, but I added a TODO comment
with this Jira key along with explanation of what needs to be done.
(
https://hibernate.atlassian.net/browse/HHH-16571#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16571#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:5ff5564 )