해결된 질문
작성
·
424
·
수정됨
0
예를들어 Order클래스에서 setMember을 대신해 @Builer사용시에는 이렇게 작성하는게 맞을까요?
@Builder
private Order(Member member, Delivery delivery, List<OrderItem> orderItems,LocalDateTime orderDate,OrderStatus status){
this.member = member;
this.delivery = delivery;
this.orderItems = orderItems;
this.orderDate = orderDate;
this.status = status;
if (member != null) {
member.getOrders().add(this);
}
}