mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-24 13:44:33 +00:00
added columns for tracking created/updated
This commit is contained in:
@@ -6,6 +6,7 @@ import net.dv8tion.jda.api.entities.ChannelType;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -38,6 +39,15 @@ public class AChannel implements SnowFlake {
|
||||
@Enumerated(EnumType.STRING)
|
||||
private AChannelType type;
|
||||
|
||||
@Column(name = "created")
|
||||
private Instant created;
|
||||
|
||||
@PrePersist
|
||||
private void onInsert() {
|
||||
this.created = Instant.now();
|
||||
}
|
||||
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Column
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -31,6 +32,14 @@ public class AChannelGroup {
|
||||
@JoinColumn(name = "group_server", nullable = false)
|
||||
private AServer server;
|
||||
|
||||
@Column(name = "created")
|
||||
private Instant created;
|
||||
|
||||
@PrePersist
|
||||
private void onInsert() {
|
||||
this.created = Instant.now();
|
||||
}
|
||||
|
||||
@ManyToMany
|
||||
@JoinTable(
|
||||
name = "channel_in_group",
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@@ -41,6 +42,22 @@ public class AConfig {
|
||||
@Setter
|
||||
private AServer server;
|
||||
|
||||
@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;
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@@ -43,6 +44,22 @@ public class AEmote {
|
||||
@JoinColumn(name = "emote_server_id", nullable = false)
|
||||
private AServer serverRef;
|
||||
|
||||
@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;
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@@ -37,6 +38,22 @@ public class AFeatureFlag {
|
||||
@Setter
|
||||
private boolean enabled;
|
||||
|
||||
@Column(name = "created")
|
||||
private Instant created;
|
||||
|
||||
@PrePersist
|
||||
private void onInsert() {
|
||||
this.created = Instant.now();
|
||||
}
|
||||
|
||||
@Column(name = "updated")
|
||||
private Instant updateTimestamp;
|
||||
|
||||
@PreUpdate
|
||||
private void onUpdate() {
|
||||
this.updateTimestamp = Instant.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@@ -32,6 +33,22 @@ public class ARole implements SnowFlake, Serializable {
|
||||
@Setter
|
||||
private Boolean deleted;
|
||||
|
||||
@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;
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -26,6 +27,22 @@ public class AServer implements SnowFlake, Serializable {
|
||||
|
||||
private String name;
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
@OneToMany(
|
||||
fetch = FetchType.LAZY,
|
||||
orphanRemoval = true,
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -27,6 +28,22 @@ public class AUser {
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
private List<AUserInAServer> servers;
|
||||
|
||||
@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;
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@@ -29,6 +30,22 @@ public class AUserInAServer implements Serializable {
|
||||
@JoinColumn(name = "serverReference", nullable = false)
|
||||
private AServer serverReference;
|
||||
|
||||
@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;
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@@ -33,6 +34,22 @@ public class PostTarget {
|
||||
@Getter @Setter
|
||||
private AServer serverReference;
|
||||
|
||||
@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