Skip to content

Commit

Permalink
[FEAT] 댓글 Cascade 적용 (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
Profile-exe authored Jul 26, 2024
1 parent db57bbe commit aea91bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/econo/buddybridge/post/entity/Post.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package econo.buddybridge.post.entity;


import econo.buddybridge.comment.entity.Comment;
import econo.buddybridge.common.persistence.BaseEntity;
import econo.buddybridge.matching.entity.Matching;
import econo.buddybridge.member.entity.DisabilityType;
Expand Down Expand Up @@ -75,6 +76,9 @@ public class Post extends BaseEntity {
@OneToMany(mappedBy = "post", orphanRemoval = true, cascade = CascadeType.ALL)
private final List<Matching> matchings = new ArrayList<>();

@OneToMany(mappedBy = "post", orphanRemoval = true, cascade = CascadeType.ALL)
private final List<Comment> comments = new ArrayList<>();

public void changeStatus(PostStatus status){ // 상태 변경
this.postStatus = status;
}
Expand Down

0 comments on commit aea91bd

Please sign in to comment.