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

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -