添加关系时,无法创建实体管理器

时间:2016-02-29 14:04:07

标签: java hibernate jpa entitymanager one-to-one

我的课程:

@Entity
public class Contacts {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
    private String login;
    private long token;

    @OneToOne
    @PrimaryKeyJoinColumn
    private UserInfo user;
//constructors, getters...
}
@Entity(name = "user_info")
public class UserInfo {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
    private String name;
    @OneToOne(mappedBy = "user")
    @PrimaryKeyJoinColumn
    private Contacts contact;
}

我收到此错误:java.lang.NoSuchMethodError:javax.persistence.OneToOne.orphanRemoval()Z

0 个答案:

没有答案