File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
back/src/main/java/com/back/domain/post/entity Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 11package com .back .domain .post .entity ;
22
33import com .back .domain .comment .entity .Comment ;
4+ import com .back .domain .poll .entity .PollVote ;
45import com .back .domain .post .enums .PostCategory ;
56import com .back .domain .user .entity .User ;
67import com .back .global .baseentity .BaseEntity ;
@@ -64,6 +65,10 @@ public class Post extends BaseEntity {
6465 @ Builder .Default
6566 private List <Comment > comments = new ArrayList <>();
6667
68+ @ OneToMany (mappedBy = "post" , cascade = CascadeType .ALL , orphanRemoval = true )
69+ @ Builder .Default
70+ private List <PollVote > pollVotes = new ArrayList <>();
71+
6772 public void updatePost (String title , String content , PostCategory category ) {
6873 this .title = title ;
6974 this .content = content ;
You can’t perform that action at this time.
0 commit comments