JUnit テストで参照整合性制約違反が発生しました。playframework と私の 2 つのエンティティを使用すると、次のようになります。
@Entity
public class User extends Model{
public String email;
public String password;
@OneToOne(mappedBy="user",cascade=CascadeType.ALL)
public Patent patent;
}
@Entity
public class Patent extends Model{
@OneToOne
public User user;
}
私の Junit テストでは、次の行が失敗します
User.findById(user.id)._delete();
Referential integrity constraint violation: "FK340C82E547140EFE: PUBLIC.PATENT FOREIGN KEY(USER_ID) REFERENCES PUBLIC.USER(ID)"; SQL statement:
delete from User where id=? [23003-149]
ありがとうございました