We're updating the issue view to help you get more done. 

@MapsId stopped working correctly migrating from hibernate 5.3 to 5.4

Description

I have a relationship similar to this one:

1 2 3 4 5 6 7 8 9 @Entity public class EntityA { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @OneToOne(cascade = ALL) @PrimaryKeyJoinColumn private EntityB mydata;

and

1 2 3 4 5 6 7 8 9 @Entity public class EntityB { @Id private Integer id; @MapsId @OneToOne @JoinColumn(name = "id", updatable = false) private EntityA a;

and while everything worked fine until hibernate 5.3, it does not work anymore with 5.4, with this error:

Caused by: org.hibernate.id.IdentifierGenerationException: null id generated for:class EntityB

Environment

None

Status

Assignee

Unassigned

Reporter

Alessandro Polverini

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.3.10

Components

Affects versions

5.4.2

Priority

Blocker