분류 전체보기
-
object references an unsaved transient instance - save the transient instance before flushing에러 일기 2023. 2. 1. 20:15
주문 기능을 구현하려고 하다가 발생한 에러이다. Member member = memberService.createMember( ... ) itemService.createItem( ... , member) 위 과정에서 터진 에러인데, 알고보니 memberService.createMember쪽에서 생성된 member를 memberRepository에 저장하지 않았다. memberRepository.save(member) 를 사이에 넣어주니 해결!
-
PersistentObjectException: detached entity passed to persist에러 일기 2023. 2. 1. 03:50
엔티티 종속에 관한 에러였다. public class Order { @Id @GeneratedValue private Long id; private OrderStatus status; @ManyToOne(fetch = LAZY) @JoinColumn(name = "member_id") private Member member; @OneToOne(cascade = CascadeType.ALL, fetch = LAZY) @JoinColumn(name = "delivery_id") private Delivery delivery; @OneToMany(mappedBy = "order") private List orderItemList = new ArrayList(); ... } public class Deliver..