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.3 and previous versions og 6. The @NamedEntityGraph 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() |