Skip to content

Commit

Permalink
refactor: 연관관계 설정 방식 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
kimjm9841 committed Feb 13, 2024
1 parent 587f904 commit aa59ba7
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit aa59ba7

Please sign in to comment.