Hi i have : public class User implements Serializable{ ... private User referer; ... @Id @NotNull @Column(name="username") public String getUserName() {return userName;} public void setUserName(String userName) {this.userName = userName;} ... @NotNull @OneToOne @PrimaryKeyJoinColumn public User getReferer() {return referer;} public void setReferer(User referer) {this.referer = referer;} .... } } i can't get it to work , i've tried mappedby and join column allso when i use it like above it says that referer can't be null but it's not null it holds a valid user (i inserted one into db manualy) . and when try to use other ways it says unknow on userName ... what am i doing wrong ? thanks