@Entity(name = "Event") public static class Event { @Id @GeneratedValue private Long id; @Column(name = "`timestamp`") @CreationTimestamp private Date timestamp; //Constructors, getters, and setters are omitted for brevity //end::mapping-generated-CreationTimestamp-example[] public Event() {} public Long getId() { return id; } public Date getTimestamp() { return timestamp; } //tag::mapping-generated-CreationTimestamp-example[] } //end::mapping-generated-CreationTimestamp-example[]
@CreationTimestamp private Date vmCreatedDate; @CreationTimestamp private Calendar vmCreatedCalendar; @CreationTimestamp private java.sql.Date vmCreatedSqlDate; @CreationTimestamp private Time vmCreatedSqlTime; @CreationTimestamp private Timestamp vmCreatedSqlTimestamp; @CreationTimestamp private Instant vmCreatedSqlInstant; @CreationTimestamp private LocalDate vmCreatedSqlLocalDate; @CreationTimestamp private LocalTime vmCreatedSqlLocalTime; @CreationTimestamp private LocalDateTime vmCreatedSqlLocalDateTime; @CreationTimestamp private MonthDay vmCreatedSqlMonthDay;
@CreationTimestamp private Date vmCreatedDate; @CreationTimestamp private Calendar vmCreatedCalendar; @CreationTimestamp private java.sql.Date vmCreatedSqlDate; @CreationTimestamp private Time vmCreatedSqlTime; @CreationTimestamp private Timestamp vmCreatedSqlTimestamp; @CreationTimestamp private Instant vmCreatedSqlInstant; @CreationTimestamp private LocalDate vmCreatedSqlLocalDate; @CreationTimestamp private LocalTime vmCreatedSqlLocalTime; @CreationTimestamp private LocalDateTime vmCreatedSqlLocalDateTime; @CreationTimestamp private MonthDay vmCreatedSqlMonthDay;
@CreationTimestamp private Date createdOn;
@CreationTimestamp private Date createdOn;
@CreationTimestamp private Date createdOn;
@CreationTimestamp private Date createdOn;
@CreationTimestamp private Date createdOn;
@CreationTimestamp private Date createdOn;
@CreationTimestamp private Date createdOn;
@CreationTimestamp private Date createdOn;
@CreationTimestamp private Date createdOn;
@CreationTimestamp private Date createdOn;
@CreationTimestamp @Temporal(TemporalType.TIMESTAMP) @Column(name = "created_at", updatable = false)
@CreationTimestamp private Date createdOn;
@CreationTimestamp private Date createdOn;
@CreationTimestamp private Date createdOn;
private Integer version; @CreationTimestamp private Date creationDate;
private Integer version; @CreationTimestamp private Date creationDate;
private Integer version; @CreationTimestamp private Date creationDate;