diff options
Diffstat (limited to 'src/main/java/com/juick/data/entities/ReplyEntity.java')
-rw-r--r-- | src/main/java/com/juick/data/entities/ReplyEntity.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/com/juick/data/entities/ReplyEntity.java b/src/main/java/com/juick/data/entities/ReplyEntity.java index e7f3d053..bc0795cf 100644 --- a/src/main/java/com/juick/data/entities/ReplyEntity.java +++ b/src/main/java/com/juick/data/entities/ReplyEntity.java @@ -24,11 +24,12 @@ import jakarta.persistence.*; public class ReplyEntity extends BaseMessagePropertyEntity { @Id @Column(name = "reply_id") - @GeneratedValue(strategy = GenerationType.AUTO) + @GeneratedValue(strategy = GenerationType.IDENTITY) private Long replyId; @Column(name = "txt") - private - String text; + private String text; + @ManyToOne(cascade = CascadeType.MERGE) + private UserEntity user; public String getText() { return text; @@ -45,4 +46,12 @@ public class ReplyEntity extends BaseMessagePropertyEntity { public void setReplyId(Long replyId) { this.replyId = replyId; } + + public UserEntity getUser() { + return user; + } + + public void setUser(UserEntity user) { + this.user = user; + } } |