diff --git a/src/main/java/com/onnoff/onnoff/domain/off/memoir/entity/MemoirAnswer.java b/src/main/java/com/onnoff/onnoff/domain/off/memoir/entity/MemoirAnswer.java index 13e21b3..6fc56a0 100644 --- a/src/main/java/com/onnoff/onnoff/domain/off/memoir/entity/MemoirAnswer.java +++ b/src/main/java/com/onnoff/onnoff/domain/off/memoir/entity/MemoirAnswer.java @@ -29,9 +29,4 @@ public class MemoirAnswer extends BaseEntity { public void setAnswer(String answer) { this.answer = answer; } - - public void setMemoir(Memoir memoir) { - this.memoir = memoir; - memoir.getMemoirAnswerList().add(this); - } } diff --git a/src/main/java/com/onnoff/onnoff/domain/off/memoir/service/MemoirServiceImpl.java b/src/main/java/com/onnoff/onnoff/domain/off/memoir/service/MemoirServiceImpl.java index c4dfb4c..06c6054 100644 --- a/src/main/java/com/onnoff/onnoff/domain/off/memoir/service/MemoirServiceImpl.java +++ b/src/main/java/com/onnoff/onnoff/domain/off/memoir/service/MemoirServiceImpl.java @@ -61,10 +61,11 @@ public Memoir writeMemoir(MemoirRequestDTO.MemoirWriteDTO request) { MemoirAnswer newMemoirAnswer = MemoirAnswer.builder() .answer(memoirAnswer.getAnswer().trim()) + .memoir(newMemoir) .memoirQuestion(memoirQuestion) .build(); - newMemoirAnswer.setMemoir(newMemoir); + newMemoir.getMemoirAnswerList().add(newMemoirAnswer); memoirAnswerRepository.save(newMemoirAnswer); }