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)