@Entity public class Foo { @CreatedDate private LocalDateTime createdDateTime; @CreationTimestamp private LocalDateTime creationTimestamp; }
Spring boot实体类中 我不知道该用哪一个 有什么不同?
@CreatedDate
@CreationTimestamp
就其实际作用而言,它们与支持更多数据类型的 Spring 变体几乎相同。