Comment.java 908 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package nju.seec.helper.data.entity;
  2. import lombok.Data;
  3. import nju.seec.helper.util.enums.UserType;
  4. import org.hibernate.annotations.CreationTimestamp;
  5. import javax.persistence.*;
  6. import java.time.LocalDateTime;
  7. /**
  8. * @author cst
  9. */
  10. @Data
  11. @Entity
  12. @Table(name = "comment")
  13. public class Comment {
  14. @Id
  15. @GeneratedValue(strategy = GenerationType.IDENTITY)
  16. private Integer id;
  17. @Column(name = "item_id")
  18. private Integer itemId;
  19. @Column(name = "user_id")
  20. private Integer userId;
  21. @Column(name = "username")
  22. private String username;
  23. @Enumerated(EnumType.STRING)
  24. @Column(name = "user_type")
  25. private UserType userType;
  26. private String content;
  27. @Column(name = "publish_time", updatable = false)
  28. @CreationTimestamp
  29. private LocalDateTime publishTime;
  30. @ManyToOne
  31. @JoinColumn(name = "father_comment_id")
  32. private Comment fatherComment;
  33. }