IdClass broken column mapping in `@OneToOne` when `mappedBy` is used by the owning side

Description

When two entities are created, one of which is parent, the owning side. The other non-owning, having composite primary key using IdClass, referencing one column to the id of the parent entity.

When there is a @OneToOne relantionship between these entities, and the parent tries to reference this relantionship using mappedBy the following error is thrown:

java.lang.RuntimeException: Could not build SessionFactory: broken column mapping for: text.id of: org.hibernate.orm.test.idclass.IdClassWithOneToOneTest$Task

which was working correctly in the version 6.2.1

Attaching a test case: https://github.com/hibernate/hibernate-orm/compare/main...The-Huginn:hibernate-orm:idClass-oneToOne-test

Activity

Show:

Rastislav Budinsky October 11, 2023 at 7:57 AM

Fixed

Details

Assignee

Reporter

Worked in

Fix versions

Affects versions

Priority

Created October 4, 2023 at 10:25 AM
Updated October 26, 2023 at 3:34 PM
Resolved October 13, 2023 at 11:03 AM

Flag notifications