This is my Database structure, One-to-One mapping in MySQL:
This is my java file:
You told Hibernate to generate the EmployeeDetail ID from the ID of its employee property, but you never initialized this property.
employee
Add edetail.setEmployee(employee); to your code.
edetail.setEmployee(employee);