File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
back/src/main/java/com/back/domain Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 11package com .back .domain .comment .entity ;
22
3+ import com .back .domain .like .entity .CommentLike ;
34import com .back .domain .post .entity .Post ;
45import com .back .domain .user .entity .User ;
56import com .back .global .baseentity .BaseEntity ;
@@ -47,6 +48,10 @@ public class Comment extends BaseEntity {
4748
4849 private int likeCount ;
4950
51+ @ OneToMany (mappedBy = "comment" , cascade = CascadeType .ALL , orphanRemoval = true )
52+ @ Builder .Default
53+ private List <CommentLike > commentLikes = new ArrayList <>();
54+
5055 @ LastModifiedDate
5156 private LocalDateTime updatedAt ;
5257
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 .like .entity .PostLike ;
45import com .back .domain .poll .entity .PollVote ;
56import com .back .domain .post .enums .PostCategory ;
67import com .back .domain .scenario .entity .Scenario ;
@@ -72,6 +73,10 @@ public class Post extends BaseEntity {
7273 @ Builder .Default
7374 private List <PollVote > pollVotes = new ArrayList <>();
7475
76+ @ OneToMany (mappedBy = "post" , cascade = CascadeType .ALL , orphanRemoval = true )
77+ @ Builder .Default
78+ private List <PostLike > postLikes = new ArrayList <>();
79+
7580 @ OneToOne (fetch = FetchType .LAZY )
7681 @ JoinColumn (name = "scenario_id" )
7782 private Scenario scenario ;
You can’t perform that action at this time.
0 commit comments