blob: 268ba6440d887c295e376d9d5516c07a4fb7fe33 [file] [log] [blame]
2230110243e9dfe2025-05-17 16:27:12 +08001package com.pt.entity;
2
3import jakarta.persistence.Entity;
4import jakarta.persistence.GeneratedValue;
5import jakarta.persistence.GenerationType;
6import jakarta.persistence.Id;
22301102f5670302025-06-08 14:10:02 +08007import org.hibernate.annotations.Formula;
2230110243e9dfe2025-05-17 16:27:12 +08008
9import java.time.LocalDateTime;
10
11@Entity
12public class Comment {
13
14 @Id
15 @GeneratedValue(strategy = GenerationType.IDENTITY)
16 private int commentId;
17
18 private String content;
19 private String writer;
20 private int parentPost;
21
22 private LocalDateTime publishDate;
23
22301102f5670302025-06-08 14:10:02 +080024 private Integer reviewer;
25
2230110243e9dfe2025-05-17 16:27:12 +080026 public Comment() {
27 publishDate = LocalDateTime.now();
28 }
29
30 public Comment(String content, String writer, int parentPost) {
31 this.content = content;
32 this.writer = writer;
33 this.parentPost = parentPost;
34 this.publishDate = LocalDateTime.now();
35 }
36
37 public int getCommentId() {
38 return commentId;
39 }
40
41 public void setCommentId(int commentId) {
42 this.commentId = commentId;
43 }
44
45 public String getContent() {
46 return content;
47 }
48
49 public void setContent(String content) {
50 this.content = content;
51 }
52
53 public String getWriter() {
54 return writer;
55 }
56
57 public void setWriter(String writer) {
58 this.writer = writer;
59 }
60
61 public int getParentPost() {
62 return parentPost;
63 }
64
65 public void setParentPost(int parentPost) {
66 this.parentPost = parentPost;
67 }
68
69 public LocalDateTime getPublishDate() {
70 return publishDate;
71 }
72
73 public void setPublishDate(LocalDateTime publishDate) {
74 this.publishDate = publishDate;
75 }
22301102f5670302025-06-08 14:10:02 +080076
77 public Integer getReviewer() {
78 return reviewer;
79 }
80 public void setReviewer(Integer reviewer) {
81 this.reviewer = reviewer;
82 }
2230110243e9dfe2025-05-17 16:27:12 +080083}
84
85