@Generated (GenerationTime.ALWAYS) @Column (name = "create_date", insertable = false, updatable = false)





У вас есть 3 варианта.
ALWAYS
Indicates the value is generated on insert and on update.
INSERT
Indicates the value is generated on insert.
NEVER
Indicates the value is never generated.
GenerationTime.ALWAYS
GenerationTime.ALWAYS updates the entity at both time insert and update. In the case of GenerationTime.ALWAYS, the property should not be insertable and updatable.
@Generated(GenerationTime.ALWAYS)
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "modified_date", updatable = false, insertable = false)
private Date modifiedDate;
GenerationTime.INSERT
GenerationTime.INSERT updates the entity only at time of insertion . In the case of GenerationTime.INSERT, the property should not be insertable.
@Generated(GenerationTime.INSERT)
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "created_date", insertable = false)
private Date createdDate;
GenerationTime.NEVER
GenerationTime.NEVER does not update the entity neither on update nor insert time.
@Generated(GenerationTime.NEVER)
Эти аннотации также могут использоваться каждым из следующих типов:
java.sql.Timestamp
@Column
@CreationTimestamp
private LocalDateTime createDateTime;
@Column
@UpdateTimestamp
private LocalDateTime updateDateTime;