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 8881af3..44211dd 100644 --- a/src/main/java/com/finfellows/domain/bookmark/domain/EduContentBookmark.java +++ b/src/main/java/com/finfellows/domain/bookmark/domain/EduContentBookmark.java @@ -30,7 +30,6 @@ 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/educontent/domain/EduContent.java b/src/main/java/com/finfellows/domain/educontent/domain/EduContent.java index 9c55a80..32eb9d2 100644 --- a/src/main/java/com/finfellows/domain/educontent/domain/EduContent.java +++ b/src/main/java/com/finfellows/domain/educontent/domain/EduContent.java @@ -1,5 +1,6 @@ package com.finfellows.domain.educontent.domain; +import com.finfellows.domain.bookmark.domain.EduContentBookmark; import com.finfellows.domain.common.BaseEntity; import com.finfellows.domain.post.domain.ContentType; import com.finfellows.domain.post.domain.Post; @@ -10,6 +11,9 @@ import lombok.NoArgsConstructor; import org.hibernate.annotations.Where; +import java.util.ArrayList; +import java.util.List; + @Entity @Table(name = "EduContent") @NoArgsConstructor(access = AccessLevel.PROTECTED) @@ -30,6 +34,8 @@ public class EduContent extends BaseEntity { @Column(name="contentType") private ContentType contentType; + @OneToMany(mappedBy = "eduContent", cascade = CascadeType.ALL) + private List eduContentBookmarkList = new ArrayList<>(); @Column(name="title") private String title;