Notice.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package nju.seec.helper.entity;
  2. import lombok.Data;
  3. import lombok.experimental.Accessors;
  4. import org.hibernate.annotations.CreationTimestamp;
  5. import org.hibernate.annotations.DynamicInsert;
  6. import org.hibernate.annotations.DynamicUpdate;
  7. import org.hibernate.annotations.UpdateTimestamp;
  8. import javax.persistence.*;
  9. import java.time.LocalDateTime;
  10. /**
  11. * @author cst
  12. */
  13. @Data
  14. @Accessors(chain = true)
  15. @Entity
  16. @Table(name = "notice")
  17. @DynamicUpdate
  18. @DynamicInsert
  19. //@Cacheable
  20. //@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
  21. public class Notice {
  22. @Id
  23. @GeneratedValue(strategy = GenerationType.IDENTITY)
  24. private Long id;
  25. @Column(name = "course_id", nullable = false)
  26. private Long courseId;
  27. @Column(name = "teacher_id", nullable = false)
  28. private Long teacherId;
  29. @Column(nullable = false)
  30. private String title;
  31. @Column(columnDefinition = "text", nullable = false)
  32. private String content;
  33. @Column(name = "create_at", nullable = false, updatable = false)
  34. @CreationTimestamp
  35. private LocalDateTime createAt;
  36. @Column(name = "update_at", nullable = false)
  37. @UpdateTimestamp
  38. private LocalDateTime updateAt;
  39. }