org.hibernate.PersistentObjectException: detached entity passed to persist: com.myomi.product.entity.Product
-> 찾아보면 Cascade문제다, sequence문제다 말만 있어서 다해봤는데 안됨
결국 생각 해낸건 연관관계!


// OrderDetail 클래스 내부
public void registerOrderAndProduct(Order order, Product product) {
this.order = order;
this.product = product;
order.addOrderDetail(this); // 이거 안해주면 one-to-one에러뜸. 지긋지긋하다
}
// Order 내부
public void addOrderDetail(OrderDetail orderDetail) {
this.orderDetails.add(orderDetail);
}