From 6be0f681e85b2fe822f9f5e7dce5f78a33c08040 Mon Sep 17 00:00:00 2001 From: LeeJaeHyeok97 Date: Wed, 17 Jan 2024 15:10:58 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]:=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20=EC=A0=9C=EC=95=BD=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/finfellows/domain/bookmark/domain/CmaBookmark.java | 3 +++ .../finfellows/domain/bookmark/domain/EduContentBookmark.java | 3 +++ .../domain/bookmark/domain/FinancialProductBookmark.java | 3 +++ .../finfellows/domain/bookmark/domain/NewsContentBookmark.java | 3 +++ .../finfellows/domain/bookmark/domain/PolicyInfoBookmark.java | 3 +++ .../com/finfellows/domain/bookmark/domain/PostBookmark.java | 3 +++ 6 files changed, 18 insertions(+) diff --git a/src/main/java/com/finfellows/domain/bookmark/domain/CmaBookmark.java b/src/main/java/com/finfellows/domain/bookmark/domain/CmaBookmark.java index e54632f..d2b84f5 100644 --- a/src/main/java/com/finfellows/domain/bookmark/domain/CmaBookmark.java +++ b/src/main/java/com/finfellows/domain/bookmark/domain/CmaBookmark.java @@ -8,6 +8,8 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; import org.hibernate.annotations.Where; @Entity @@ -29,6 +31,7 @@ public class CmaBookmark extends BaseEntity { // 금융 뭐하지 id @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "cma_id") + @OnDelete(action = OnDeleteAction.CASCADE) private CMA cma; @Builder diff --git a/src/main/java/com/finfellows/domain/bookmark/domain/EduContentBookmark.java b/src/main/java/com/finfellows/domain/bookmark/domain/EduContentBookmark.java index c207195..8881af3 100644 --- a/src/main/java/com/finfellows/domain/bookmark/domain/EduContentBookmark.java +++ b/src/main/java/com/finfellows/domain/bookmark/domain/EduContentBookmark.java @@ -8,6 +8,8 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; import org.hibernate.annotations.Where; @Entity @@ -28,6 +30,7 @@ public class EduContentBookmark extends BaseEntity { // 금융 배우자 id @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "edu_content_id") + @OnDelete(action = OnDeleteAction.CASCADE) private EduContent eduContent; @Builder diff --git a/src/main/java/com/finfellows/domain/bookmark/domain/FinancialProductBookmark.java b/src/main/java/com/finfellows/domain/bookmark/domain/FinancialProductBookmark.java index d8f631c..891a311 100644 --- a/src/main/java/com/finfellows/domain/bookmark/domain/FinancialProductBookmark.java +++ b/src/main/java/com/finfellows/domain/bookmark/domain/FinancialProductBookmark.java @@ -8,6 +8,8 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; import org.hibernate.annotations.Where; @Entity @@ -28,6 +30,7 @@ public class FinancialProductBookmark extends BaseEntity { // 금융 뭐하지 id @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "financial_product_id") + @OnDelete(action = OnDeleteAction.CASCADE) private FinancialProduct financialProduct; @Builder diff --git a/src/main/java/com/finfellows/domain/bookmark/domain/NewsContentBookmark.java b/src/main/java/com/finfellows/domain/bookmark/domain/NewsContentBookmark.java index a37b289..51ad5f1 100644 --- a/src/main/java/com/finfellows/domain/bookmark/domain/NewsContentBookmark.java +++ b/src/main/java/com/finfellows/domain/bookmark/domain/NewsContentBookmark.java @@ -8,6 +8,8 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; import org.hibernate.annotations.Where; @Entity @@ -27,6 +29,7 @@ public class NewsContentBookmark extends BaseEntity { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "news_content_id") + @OnDelete(action = OnDeleteAction.CASCADE) private NewsContent newsContent; @Builder diff --git a/src/main/java/com/finfellows/domain/bookmark/domain/PolicyInfoBookmark.java b/src/main/java/com/finfellows/domain/bookmark/domain/PolicyInfoBookmark.java index 1ae615d..0bab32c 100644 --- a/src/main/java/com/finfellows/domain/bookmark/domain/PolicyInfoBookmark.java +++ b/src/main/java/com/finfellows/domain/bookmark/domain/PolicyInfoBookmark.java @@ -8,6 +8,8 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; import org.hibernate.annotations.Where; @Entity @@ -28,6 +30,7 @@ public class PolicyInfoBookmark extends BaseEntity { // 금융 고마워 id @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "policy_info_id") + @OnDelete(action = OnDeleteAction.CASCADE) private PolicyInfo policyInfo; @Builder diff --git a/src/main/java/com/finfellows/domain/bookmark/domain/PostBookmark.java b/src/main/java/com/finfellows/domain/bookmark/domain/PostBookmark.java index b30dc1e..c5d7dd4 100644 --- a/src/main/java/com/finfellows/domain/bookmark/domain/PostBookmark.java +++ b/src/main/java/com/finfellows/domain/bookmark/domain/PostBookmark.java @@ -9,6 +9,8 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; import org.hibernate.annotations.Where; @Entity @@ -28,6 +30,7 @@ public class PostBookmark extends BaseEntity { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "post_id") + @OnDelete(action = OnDeleteAction.CASCADE) private Post post; @Enumerated(EnumType.STRING)