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
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 usingmappedBy
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