Skip to content

Commit

Permalink
🧩:: orphanRemoval 설정 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyoil2 committed Dec 25, 2023
1 parent db9f74c commit c3b9850
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class Petition {
@JoinColumn(name = "user_id")
private User user;

@OneToMany(mappedBy = "petition", cascade = CascadeType.REMOVE)
@OneToMany(mappedBy = "petition", cascade = CascadeType.REMOVE, orphanRemoval = true)
@JoinColumn(name = "vote_id")
private List<Vote> voteList = new ArrayList<>();

Expand All @@ -82,5 +82,5 @@ public void addVoteCount() {
public void minusVoteCount() {
this.voteCounts--;
}

}

0 comments on commit c3b9850

Please sign in to comment.