mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-06 00:15:32 +00:00
added columns for tracking created/updated
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user