我想我误解了@多对一关系上下文中级联的含义。
案例:
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这一事实如何。所有影响我的数据(我猜是用户)?