0
我使用的是hibernate 4.1.0,jpa 2.1.when當我試着把一對多關係我得到上面的錯誤。 我已經嘗試過其他的解決方案堆棧溢出,但他們不知道,對我來說將不起作用NoSuchMethodError:javax.persistence.OneToOne.orphanRemoval()Z
這裏是我的bean類:
@Entity
public class Users implements Serializable {
@GeneratedValue(strategy = GenerationType.AUTO)
@Id
private int Id;
private int orgId;
private String salutation;
private String firstName;
private String lastName;
private String email;
private String telephone;
private String universalRecordLocator;
private String password;
private String userLevel;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "employee_id")
UserRoles userRoles;
public int getId() {
return Id;
}
...
波紋管是堆棧跟蹤:
Exception in thread "main" java.lang.NoSuchMethodError: javax.persistence.OneToOne.orphanRemoval()Z
可能重複[NoSuchMethodError only only on Linux](http://stackoverflow.com/questions/24236521/nosuchmethoderror-only-on-linux) –
也dup的https://stackoverflow.com/questions/35701588/cant -create-entity-manager-when-add-relationships和許多其他問題,如果只搜索了...... –