From b71323cc4e526c6c22dd5590ccbf429fd615f7d9 Mon Sep 17 00:00:00 2001 From: jenny <88226911+kmjenny@users.noreply.github.com> Date: Wed, 14 Feb 2024 21:36:51 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20#16=20Cascade=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/org/harang/server/domain/Category.java | 2 +- src/main/java/org/harang/server/domain/Help.java | 2 +- src/main/java/org/harang/server/domain/MemberInfo.java | 4 ++-- src/main/java/org/harang/server/domain/Post.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/harang/server/domain/Category.java b/src/main/java/org/harang/server/domain/Category.java index f3f79d3..36d6854 100644 --- a/src/main/java/org/harang/server/domain/Category.java +++ b/src/main/java/org/harang/server/domain/Category.java @@ -21,7 +21,7 @@ public class Category { @Column(name = "name", nullable = false) private String name; - @OneToMany(mappedBy = "category") + @OneToMany(mappedBy = "category", cascade = CascadeType.ALL) private List postCategoryList = new ArrayList<>(); @Builder diff --git a/src/main/java/org/harang/server/domain/Help.java b/src/main/java/org/harang/server/domain/Help.java index 07dd418..9a0f2e1 100644 --- a/src/main/java/org/harang/server/domain/Help.java +++ b/src/main/java/org/harang/server/domain/Help.java @@ -22,7 +22,7 @@ public class Help { private String name; /* Relation Parent Mapping */ - @OneToMany(mappedBy = "help") + @OneToMany(mappedBy = "help", cascade = CascadeType.ALL) private List memberHelpList = new ArrayList<>(); @Builder diff --git a/src/main/java/org/harang/server/domain/MemberInfo.java b/src/main/java/org/harang/server/domain/MemberInfo.java index 4dc4339..94509e3 100644 --- a/src/main/java/org/harang/server/domain/MemberInfo.java +++ b/src/main/java/org/harang/server/domain/MemberInfo.java @@ -32,10 +32,10 @@ public class MemberInfo { private String refreshToken; /* Relation Parent Mapping */ - @OneToMany(mappedBy = "memberInfo") + @OneToMany(mappedBy = "memberInfo", cascade = CascadeType.ALL) private List memberHelpList = new ArrayList<>(); - @OneToMany(mappedBy = "memberInfo") + @OneToMany(mappedBy = "memberInfo", cascade = CascadeType.ALL) private List certificationList = new ArrayList<>(); @Builder diff --git a/src/main/java/org/harang/server/domain/Post.java b/src/main/java/org/harang/server/domain/Post.java index 57109e7..f786de7 100644 --- a/src/main/java/org/harang/server/domain/Post.java +++ b/src/main/java/org/harang/server/domain/Post.java @@ -55,10 +55,10 @@ public class Post { private Status status = Status.WAITING; /* Relation Parent Mapping */ - @OneToMany(mappedBy = "post", cascade = CascadeType.REMOVE) + @OneToMany(mappedBy = "post", cascade = CascadeType.ALL) private List matchingList = new ArrayList<>(); - @OneToMany(mappedBy = "post", cascade = CascadeType.REMOVE) + @OneToMany(mappedBy = "post", cascade = CascadeType.ALL) private List postCategoryList = new ArrayList<>(); @Builder