订单生命周期 - 在对象或单独的类中建模

时间:2013-02-11 19:51:55

标签: java model lifecycle

@Entity
public class Order{

     @ManyToOne
     private LocalStore store;
     private OrderStatus status;


     public void acceptOrder(LocalStore store){
        //business logic
     }
}

在域对象中使用生命周期方法会更好吗? 将它放在另一个班级会更好吗? (例如......以上内容可能会强制LocalStore级联持久性。)

0 个答案:

没有答案