I have an entity with a field to save the date when the entity was updated. I'm using the annotations below:
@Temporal(TemporalType.TIMESTAMP)
@UpdateTimestamp
@Column(name = "updated_at", nullable = true)
private Date updatedAt;
I want updatedAt in null as default value but I have as default value the same date when the entity was created.
In my @Service class I save the entity like this:
visitorRepository.saveAndFlush(visitor)
There is a way to save my updatedAt in null as default value using @UpdateTimestamp?