java - Jpa unidirectional @OneToOne where columns should be created in another table -
i have employee , department requirement, want field department in employee entity, want department hold foreign key, rather employee holding dept_id. later can achieved using @joincolumn. mapped not option, unidirectional.
do know if there way so?
it joincolumn should use , set attributes of annotation correct way.
class department { @onetoone @joincolumn(name="id",referencedcolumnname = "here comes foreign key departmentid ") employee employee; }
Comments
Post a Comment