From d0548524a51a8229f500416d5cd712abf069a901 Mon Sep 17 00:00:00 2001 From: jhy Date: Sat, 12 Aug 2023 19:25:17 +0900 Subject: [PATCH] =?UTF-8?q?[fix]:=20=EC=BB=A4=EB=AE=A4=EB=8B=88=ED=8B=B0?= =?UTF-8?q?=20=EA=B8=80=20=EC=82=AD=EC=A0=9C=20=EC=8B=9C=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=EC=8A=A4=ED=81=AC=EB=9E=A9=EB=8F=84=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/umc/refit/domain/entity/Posts.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/umc/refit/domain/entity/Posts.java b/src/main/java/com/umc/refit/domain/entity/Posts.java index 9399751..2b655de 100644 --- a/src/main/java/com/umc/refit/domain/entity/Posts.java +++ b/src/main/java/com/umc/refit/domain/entity/Posts.java @@ -46,6 +46,13 @@ public class Posts extends BaseTimeEntity { ) private List image = new ArrayList<>(); + @OneToMany( + mappedBy = "post", + cascade = {CascadeType.PERSIST, CascadeType.REMOVE}, + orphanRemoval = true + ) + private List scrap = new ArrayList<>(); + public Posts(PostDto postDto) { this.member = postDto.getMember(); this.title = postDto.getTitle();