changeset 1300:03670cc25357

Added hibernate model for audit trail.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 24 Feb 2017 14:28:42 +0100 (2017-02-24)
parents 0eece233cbae
children a3f281b350f2
files src/main/java/de/intevation/lada/model/land/AuditTrail.java src/main/java/de/intevation/lada/model/land/AuditTrailMessung.java src/main/java/de/intevation/lada/model/land/AuditTrailProbe.java
diffstat 3 files changed, 346 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/intevation/lada/model/land/AuditTrail.java	Fri Feb 24 14:28:42 2017 +0100
@@ -0,0 +1,109 @@
+package de.intevation.lada.model.land;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+import javax.json.JsonObject;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Type;
+import org.hibernate.annotations.TypeDef;
+import org.hibernate.annotations.TypeDefs;
+
+import de.intevation.lada.util.data.JsonObjectType;
+
+/**
+ * The persistent class for the audit_trail database table.
+ * 
+ */
+@Entity
+@Table(name="audit_trail")
+@TypeDefs({ @TypeDef(name = "JsonObject", typeClass = JsonObjectType.class) })
+public class AuditTrail implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    private Long id;
+
+    private String action;
+
+    @Column(name="action_tstamp_clk")
+    private Timestamp actionTstampClk;
+
+    @Column(name="changed_fields")
+    @Type(type="JsonObject")
+    private JsonObject changedFields;
+
+    @Column(name="object_id")
+    private Integer objectId;
+
+    @Column(name="row_data")
+    @Type(type="JsonObject")
+    private JsonObject rowData;
+
+    @Column(name="table_name")
+    private String tableName;
+
+    public AuditTrail() {
+    }
+
+    public Long getId() {
+        return this.id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getAction() {
+        return this.action;
+    }
+
+    public void setAction(String action) {
+        this.action = action;
+    }
+
+    public Timestamp getActionTstampClk() {
+        return this.actionTstampClk;
+    }
+
+    public void setActionTstampClk(Timestamp actionTstampClk) {
+        this.actionTstampClk = actionTstampClk;
+    }
+
+    public JsonObject getChangedFields() {
+        return this.changedFields;
+    }
+
+    public void setChangedFields(JsonObject changedFields) {
+        this.changedFields = changedFields;
+    }
+
+    public Integer getObjectId() {
+        return this.objectId;
+    }
+
+    public void setObjectId(Integer objectId) {
+        this.objectId = objectId;
+    }
+
+    public JsonObject getRowData() {
+        return this.rowData;
+    }
+
+    public void setRowData(JsonObject rowData) {
+        this.rowData = rowData;
+    }
+
+    public String getTableName() {
+        return this.tableName;
+    }
+
+    public void setTableName(String tableName) {
+        this.tableName = tableName;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/intevation/lada/model/land/AuditTrailMessung.java	Fri Feb 24 14:28:42 2017 +0100
@@ -0,0 +1,122 @@
+package de.intevation.lada.model.land;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Type;
+import org.hibernate.annotations.TypeDef;
+import org.hibernate.annotations.TypeDefs;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+import de.intevation.lada.util.data.JsonObjectType;
+
+
+/**
+ * The persistent class for the audit_trail_messung database table.
+ * 
+ */
+@Entity
+@Table(name="audit_trail_messung")
+@TypeDefs({ @TypeDef(name = "JsonObject", typeClass = JsonObjectType.class) })
+public class AuditTrailMessung implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    private Long id;
+
+    private String action;
+
+    @Column(name="tstamp")
+    private Timestamp tstamp;
+
+    @Column(name="changed_fields")
+    @Type(type="JsonObject")
+    private JsonNode changedFields;
+
+    @Column(name="messungs_id")
+    private String messungsId;
+
+    @Column(name="object_id")
+    private Integer objectId;
+
+    @Column(name="row_data")
+    @Type(type="JsonObject")
+    private JsonNode rowData;
+
+    @Column(name="table_name")
+    private String tableName;
+
+    public AuditTrailMessung() {
+    }
+
+    public String getAction() {
+        return this.action;
+    }
+
+    public void setAction(String action) {
+        this.action = action;
+    }
+
+    public Timestamp getTstamp() {
+        return this.tstamp;
+    }
+
+    public void setTstamp(Timestamp tstamp) {
+        this.tstamp = tstamp;
+    }
+
+    public JsonNode getChangedFields() {
+        return this.changedFields;
+    }
+
+    public void setChangedFields(JsonNode changedFields) {
+        this.changedFields = changedFields;
+    }
+
+    public Long getId() {
+        return this.id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getMessungsId() {
+        return this.messungsId;
+    }
+
+    public void setMessungsId(String messungsId) {
+        this.messungsId = messungsId;
+    }
+
+    public Integer getObjectId() {
+        return this.objectId;
+    }
+
+    public void setObjectId(Integer objectId) {
+        this.objectId = objectId;
+    }
+
+    public JsonNode getRowData() {
+        return this.rowData;
+    }
+
+    public void setRowData(JsonNode rowData) {
+        this.rowData = rowData;
+    }
+
+    public String getTableName() {
+        return this.tableName;
+    }
+
+    public void setTableName(String tableName) {
+        this.tableName = tableName;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/intevation/lada/model/land/AuditTrailProbe.java	Fri Feb 24 14:28:42 2017 +0100
@@ -0,0 +1,115 @@
+package de.intevation.lada.model.land;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+import javax.json.JsonObject;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Type;
+import org.hibernate.annotations.TypeDef;
+import org.hibernate.annotations.TypeDefs;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+import de.intevation.lada.util.data.JsonObjectType;
+
+/**
+ * The persistent class for the audit_trail_probe database table.
+ * 
+ */
+@Entity
+@Table(name="audit_trail_probe")
+@TypeDefs({ @TypeDef(name = "JsonObject", typeClass = JsonObjectType.class) })
+public class AuditTrailProbe implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    private Long id;
+
+    @Column(name="changed_fields")
+    @Type(type="JsonObject")
+    private JsonNode changedFields;
+
+    @Column(name="row_data")
+    @Type(type="JsonObject")
+    private JsonNode rowData;
+
+    @Column(name="tstamp")
+    private Timestamp tstamp;
+
+    @Column(name="messungs_id")
+    private Integer messungsId;
+
+    @Column(name="object_id")
+    private Integer objectId;
+
+    @Column(name="probe_id")
+    private Integer probeId;
+
+    @Column(name="table_name")
+    private String tableName;
+
+    public AuditTrailProbe() {
+    }
+
+    public JsonNode getChangedFields() {
+        return this.changedFields;
+    }
+
+    public void setChangedFields(JsonNode changedFields) {
+        this.changedFields = changedFields;
+    }
+
+    public JsonNode getRowData() {
+        return rowData;
+    }
+
+    public void setRowData(JsonNode rowData) {
+        this.rowData = rowData;
+    }
+
+    public Timestamp getTstamp() {
+        return tstamp;
+    }
+
+    public void setTstamp(Timestamp tstamp) {
+        this.tstamp = tstamp;
+    }
+
+    public Integer getMessungsId() {
+        return this.messungsId;
+    }
+
+    public void setMessungsId(Integer messungsId) {
+        this.messungsId = messungsId;
+    }
+
+    public Integer getObjectId() {
+        return this.objectId;
+    }
+
+    public void setObjectId(Integer objectId) {
+        this.objectId = objectId;
+    }
+
+    public Integer getProbeId() {
+        return this.probeId;
+    }
+
+    public void setProbeId(Integer probeId) {
+        this.probeId = probeId;
+    }
+
+    public String getTableName() {
+        return this.tableName;
+    }
+
+    public void setTableName(String tableName) {
+        this.tableName = tableName;
+    }
+
+}
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)