Søren Jepsen (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ca1c89...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZDU4NmJmZThm...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15622?atlOrigin=eyJpIjoiZDU4Nm...
) HHH-15622 (
https://hibernate.atlassian.net/browse/HHH-15622?atlOrigin=eyJpIjoiZDU4Nm...
) Query bug in @NamedEntityGraph when doing Eager loading of @OneToOne mappings in Single
Table inheritance (
https://hibernate.atlassian.net/browse/HHH-15622?atlOrigin=eyJpIjoiZDU4Nm...
)
Issue Type: Bug Affects Versions: 6.0.0, 6.1.3, 6.1.4 Assignee: Unassigned Components:
hibernate-core, hibernate-entitymanager Created: 24/Oct/2022 01:17 AM Environment:
Hibernate 6.1.3.Final
Postgres 14
Java version: 17.0.3, vendor: Eclipse Adoptium
MacOS Montery 12.5
Priority: Major Reporter: Søren Jepsen (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ca1c89...
)
There appears to be a bug in *@NamedEntityGraph* (
https://github.com/entitygraph ) when
trying to eager load a *@OnetoOne* (
https://github.com/OnetoOne ) mapping with *@Mapsid*
(
https://github.com/mapsid ) in a Single Table inheritance setup.
When doing eager loading, I get the following error:
Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: uuid =
character varying Hint: No operator matches the given name and argument types. You might
need to add explicit type casts.
Generated sql:
'select
p1_0.id,d1_0.parent_id,d1_0.dtype,d1_0.organization_id,d1_0.module_width,p1_0.organization_id
from physical_aspect p1_0 left join physical_aspect_definition d1_0 on p1_0.id=d1_0.dtype
where p1_0.organization_id=?'
Seems like trying to compare id=dtype (discriminator column).
The bug appears in Hibernate 6.1.3 and previous versions og 6.
The @NamedEntityGraph (
https://github.com/entitygraph ) feature is tested working with
Hibernate 5.6.11
I've included a testcase for both 6.1.3 and 5.6.11.
-> See EagerLoadingEntityGraphTest#testEagerloadingByNamedEntityGraphAnnotationFails()
(
https://hibernate.atlassian.net/browse/HHH-15622#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15622#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#100209- sha1:392b984 )