Currently I have a base entity as follows:
@MappedSuperclass
public abstract class BaseEntity {
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE)
private Long id;
private boolean deleted;
@Convert(converter = LocalDateTimePersistenceConverter.class)
private LocalDateTime createdAt;
@Convert(converter = LocalDateTimePersistenceConverter.class)
private LocalDateTime updatedAt;
}
Is it possible to annotate LocalDateTime
with something to make database default to current date and time?
p.s. I am not allowed to use hibernate 5.