Skip to content

Commit

Permalink
[Merge] main <- seyong#133-fix-persistence
Browse files Browse the repository at this point in the history
[Fix] 스냅삭제 시 댓글테이블에 영속성전이가 되지않는 문제 해결
  • Loading branch information
parseyong authored Aug 10, 2024
2 parents 321c6e6 + a6a0c50 commit eaf4480
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/me/snaptime/reply/domain/ChildReply.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class ChildReply extends BaseTimeEntity {
private User user;

@ManyToOne
@OnDelete(action = OnDeleteAction.CASCADE)
@JoinColumn(name = "parent_reply_id",nullable = false)
private ParentReply parentReply;

Expand Down
1 change: 1 addition & 0 deletions src/main/java/me/snaptime/reply/domain/ParentReply.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class ParentReply extends BaseTimeEntity {
private String content;

@ManyToOne
@OnDelete(action = OnDeleteAction.CASCADE)
@JoinColumn(name = "snap_id",nullable = false)
private Snap snap;

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/me/snaptime/snap/domain/Encryption.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import me.snaptime.user.domain.User;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import javax.crypto.SecretKey;

Expand All @@ -23,6 +25,7 @@ public class Encryption {
private SecretKey secretKey;

@OneToOne
@OnDelete(action = OnDeleteAction.CASCADE)
@JoinColumn(name = "user_id")
private User user;

Expand Down

0 comments on commit eaf4480

Please sign in to comment.