Query bug in @NamedEntityGraph when doing Eager loading of @OneToOne mappings in Single Table inheritance
Description
Attachments
2
Activity
Show:
Søren Jepsen October 24, 2022 at 11:44 AM
Test case using hibernate-test-case-templates can be found here:
Fixed
Details
Details
Assignee
Reporter
Søren Jepsen
Søren JepsenWorked in
Components
Fix versions
Priority
Created October 24, 2022 at 8:17 AM
Updated October 28, 2022 at 12:09 PM
Resolved October 27, 2022 at 6:32 PM
There appears to be a bug in @NamedEntityGraph when trying to eager load a @OnetoOne mapping with @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.4 and previous versions of 6.
The @NamedEntityGraph feature is tested working with Hibernate 5.6.11
I've included a testcase for both 6.1.4 and 5.6.11 ()