root | ff0769a | 2025-05-18 17:24:41 +0000 | [diff] [blame] | 1 | package entity; |
956303669 | fb7b920 | 2025-05-11 16:18:15 +0800 | [diff] [blame] | 2 | |
| 3 | import java.util.Date; |
| 4 | import javax.persistence.*; |
| 5 | |
| 6 | @Entity |
| 7 | @Table(name = "PostReply") |
| 8 | public class PostReply { |
| 9 | @Id |
| 10 | @Column(name = "reply_id", length = 64, nullable = false) |
| 11 | public String replyid; |
| 12 | |
| 13 | @Column(name = "post_id", length = 64, nullable = false) |
| 14 | public String postid; |
| 15 | |
| 16 | @ManyToOne(optional = false) |
| 17 | @JoinColumn(name = "post_id", referencedColumnName = "post_id", |
| 18 | foreignKey = @ForeignKey(name = "fk_pr_post"), |
| 19 | insertable = false, updatable = false) |
| 20 | public Post post; |
| 21 | |
| 22 | @Column(name = "author_id", length = 36, nullable = false) |
| 23 | public String authorid; |
| 24 | |
| 25 | @ManyToOne(optional = false) |
| 26 | @JoinColumn(name = "author_id", referencedColumnName = "user_id", |
| 27 | foreignKey = @ForeignKey(name = "fk_pr_user"), |
| 28 | insertable = false, updatable = false) |
| 29 | public User author; |
| 30 | |
| 31 | @Lob |
| 32 | @Column(name = "content", nullable = false) |
| 33 | public String content; |
| 34 | |
| 35 | @Column(name = "created_at", nullable = false) |
| 36 | @Temporal(TemporalType.TIMESTAMP) |
| 37 | public Date createdAt; |
| 38 | } |