@Entity
public class Order{
@ManyToOne
private LocalStore store;
private OrderStatus status;
public void acceptOrder(LocalStore store){
//business logic
}
}
在域对象中有生命周期方法更好吗?把这个放在不同的班级会更好吗?(例如..上面可能会强制 LocalStore 级联持久性。)