public class Customer {
//...
@OneToMany(mappedBy="customer")
private Set<Bill> bills;
//...
}
public class Bill{
//...
@OneToMany(mappedBy="bill")
private Set<BuyBill> buybills;
@ManyToOne
@JoinColumn(name="customer_id", nullable=false)
private Customer customer;
//...
}
public class Bill{
//...
@ManyToOne
@JoinColumn(name="bill_id", nullable=false)
private Bill bill;
//...
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…