我想我误解了在关系中级联的含义@ManyToOne
。
案子:
public class User {
@OneToMany(fetch = FetchType.EAGER)
protected Set<Address> userAddresses;
}
public class Address {
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
protected User addressOwner;
}
的含义是cascade = CascadeType.ALL
什么?例如,如果我从数据库中删除某个地址,我添加的事实如何cascade = CascadeType.ALL
影响我的数据(User
我猜是)?