Skip to content

Commit

Permalink
[fix] entity cascade 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryeolee committed Nov 20, 2023
1 parent ee14e3c commit f908c7f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public class Comment extends BaseEntity{
@Column(name = "comment_contents", nullable = false, length = 500)
private String commentContents;

@ManyToOne(fetch = FetchType.LAZY, optional = false)
@OnDelete(action = OnDeleteAction.CASCADE)
@ManyToOne(fetch = FetchType.LAZY, optional = false, cascade = CascadeType.REMOVE)
@JoinColumn(name = "posting_id", nullable = false)
private Posting posting;

}
}

Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public class PostingImage extends BaseEntity{
@Column(name = "image_url", nullable = false, length = 500)
private String imageUrl;

@ManyToOne(fetch = FetchType.LAZY, optional = false)
@OnDelete(action = OnDeleteAction.CASCADE)
@ManyToOne(fetch = FetchType.LAZY, optional = false, cascade = CascadeType.REMOVE)
@JoinColumn(name = "posting_id", nullable = false)
private Posting posting;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public class PostingReport extends BaseEntity{
private String reportReason;

@NotNull
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@OnDelete(action = OnDeleteAction.CASCADE)
@ManyToOne(fetch = FetchType.LAZY, optional = false, cascade = CascadeType.REMOVE)
@JoinColumn(name = "posting_id", nullable = false)
private Posting posting;

Expand Down

0 comments on commit f908c7f

Please sign in to comment.