java - Hibernate One To One Bidirectional Not working -
i trying make code have bidrectional relationship(one one) apparently code not working.
here's first class.
public class user { @onetoone(cascade = cascadetype.all) @joincolumn(name = "user_profile_fk") private userprofile userprofile; //accessor methods , other stuff }
and second class
@entity @table(name ="user_profile") public class userprofile{ @onetoone(mappedby="userprofile") private user user; //accessor methods }
now when run code exception error occurs
unknown mappedby in: org.test.myapp.user, referenced property unknown: org.test.myapp.user.userprofile
the field @ other side of association named userprofile
, not userprofile
, mappedby attribute must set userprofile
.
Comments
Post a Comment