added columns for tracking created/updated

This commit is contained in:
Sheldan
2020-05-16 00:21:53 +02:00
parent 82c63d4825
commit ddb540ccfe
26 changed files with 385 additions and 7 deletions

View File

@@ -42,6 +42,22 @@ public class Template {
@Getter
private Instant lastModified;
@Column(name = "created")
private Instant created;
@PrePersist
private void onInsert() {
this.created = Instant.now();
}
@Column(name = "updated")
private Instant updated;
@PreUpdate
private void onUpdate() {
this.updated = Instant.now();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;