Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
[FIX]: 데이터 삭제 제약조건 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
LEEJaeHyeok97 committed Jan 17, 2024
1 parent 44d7a86 commit 6be0f68
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 6be0f68

Please sign in to comment.