handleError()
这是客户地址实体,而且混淆是确定地址是用于结算还是运送?有没有办法使用isBilling或isShipping?我可以在存储库层执行此操作,在Customer中只有一个(一对多)映射,但如果可能的话,我更愿意使用Hibernate。
@Entity
public class Customer extends AbstractEntity {
@OneToMany(cascade = CascadeType.ALL, mappedBy = "customer_id")
private List<CustomerAddress> shippingAddresses;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "customer_id")
private List<CustomerAddress> billingAddresses;
// some other stuff that isn't relevant to the problem
}