Hibernate : attempted to assign id from null one-to-one property: employee

后端 未结 1 1800
谎友^
谎友^ 2020-12-15 03:19

This is my Database structure, One-to-One mapping in MySQL:

\"DB

This is my java file:

相关标签:
1条回答
  • 2020-12-15 03:42

    You told Hibernate to generate the EmployeeDetail ID from the ID of its employee property, but you never initialized this property.

    Add edetail.setEmployee(employee); to your code.

    0 讨论(0)
提交回复
热议问题