From aea91bd5c4f880dc3d9f4c40a3188383387e5c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=AA=85=EB=8D=95?= <68066437+Profile-exe@users.noreply.github.com> Date: Fri, 26 Jul 2024 11:35:31 +0900 Subject: [PATCH] =?UTF-8?q?[FEAT]=20=EB=8C=93=EA=B8=80=20Cascade=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=20(#117)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/econo/buddybridge/post/entity/Post.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/econo/buddybridge/post/entity/Post.java b/src/main/java/econo/buddybridge/post/entity/Post.java index 6896b64..91f4af6 100644 --- a/src/main/java/econo/buddybridge/post/entity/Post.java +++ b/src/main/java/econo/buddybridge/post/entity/Post.java @@ -1,6 +1,7 @@ package econo.buddybridge.post.entity; +import econo.buddybridge.comment.entity.Comment; import econo.buddybridge.common.persistence.BaseEntity; import econo.buddybridge.matching.entity.Matching; import econo.buddybridge.member.entity.DisabilityType; @@ -75,6 +76,9 @@ public class Post extends BaseEntity { @OneToMany(mappedBy = "post", orphanRemoval = true, cascade = CascadeType.ALL) private final List matchings = new ArrayList<>(); + @OneToMany(mappedBy = "post", orphanRemoval = true, cascade = CascadeType.ALL) + private final List comments = new ArrayList<>(); + public void changeStatus(PostStatus status){ // 상태 변경 this.postStatus = status; }