changeset 597:8d238aa430e3

Added new field to model classes to have the parent tree_modified timestamp available.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 08 Apr 2015 10:41:33 +0200
parents 31c4bd94d74e
children ce852671cb83
files src/main/java/de/intevation/lada/model/land/LMessung.java src/main/java/de/intevation/lada/model/land/LMesswert.java src/main/java/de/intevation/lada/model/land/LOrt.java src/main/java/de/intevation/lada/model/land/LProbe.java src/main/java/de/intevation/lada/model/land/LStatus.java src/main/java/de/intevation/lada/model/land/LZusatzWert.java
diffstat 6 files changed, 110 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/model/land/LMessung.java	Wed Mar 25 16:26:46 2015 +0100
+++ b/src/main/java/de/intevation/lada/model/land/LMessung.java	Wed Apr 08 10:41:33 2015 +0200
@@ -11,8 +11,10 @@
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
+import javax.persistence.Transient;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 
@@ -35,9 +37,16 @@
 
     private Boolean geplant;
 
-    @Column(name="tree_modified")
+    @OneToOne
+    @JoinColumn(name="probe_id", insertable=false, updatable=false)
+    private LProbe probe;
+
+    @Column(name="tree_modified", insertable=false, updatable=false)
     private Timestamp treeModified;
 
+    @Transient
+    private Timestamp parentModified;
+
     public LMessung() {
     }
 
@@ -57,6 +66,17 @@
         this.treeModified = treeModified;
     }
 
+    public Timestamp getParentModified() {
+        if (this.parentModified == null && this.probe != null) {
+            return this.probe.getTreeModified();
+        }
+        return this.parentModified;
+    }
+
+    public void setParentModified(Timestamp parentModified) {
+        this.parentModified = parentModified;
+    }
+
     public String getNebenprobenNr() {
         return nebenprobenNr;
     }
--- a/src/main/java/de/intevation/lada/model/land/LMesswert.java	Wed Mar 25 16:26:46 2015 +0100
+++ b/src/main/java/de/intevation/lada/model/land/LMesswert.java	Wed Apr 08 10:41:33 2015 +0200
@@ -11,7 +11,10 @@
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
 import javax.persistence.Table;
+import javax.persistence.Transient;
 
 
 /**
@@ -22,9 +25,16 @@
 public class LMesswert extends de.intevation.lada.model.Messwert {
     private static final long serialVersionUID = 1L;
 
-    @Column(name="tree_modified")
+    @Column(name="tree_modified", insertable=false, updatable=false)
     private Timestamp treeModified;
 
+    @OneToOne
+    @JoinColumn(name="messungs_id", insertable=false, updatable=false)
+    private LMessung messung;
+
+    @Transient
+    private Timestamp parentModified;
+
     public Timestamp getTreeModified() {
         return treeModified;
     }
@@ -32,4 +42,15 @@
     public void setTreeModified(Timestamp treeModified) {
         this.treeModified = treeModified;
     }
+
+    public Timestamp getParentModified() {
+        if (this.parentModified == null && this.messung != null) {
+            return this.messung.getTreeModified();
+        }
+        return this.parentModified;
+    }
+
+    public void setParentModified(Timestamp parentModified) {
+        this.parentModified = parentModified;
+    }
 }
--- a/src/main/java/de/intevation/lada/model/land/LOrt.java	Wed Mar 25 16:26:46 2015 +0100
+++ b/src/main/java/de/intevation/lada/model/land/LOrt.java	Wed Apr 08 10:41:33 2015 +0200
@@ -11,7 +11,10 @@
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
 import javax.persistence.Table;
+import javax.persistence.Transient;
 
 
 /**
@@ -22,9 +25,16 @@
 public class LOrt extends de.intevation.lada.model.Ort {
     private static final long serialVersionUID = 1L;
 
-    @Column(name="tree_modified")
+    @Column(name="tree_modified", insertable=false, updatable=false)
     private Timestamp treeModified;
 
+    @OneToOne
+    @JoinColumn(name="probe_id", insertable=false, updatable=false)
+    private LProbe probe;
+
+    @Transient
+    private Timestamp parentModified;
+
     public Timestamp getTreeModified() {
         return treeModified;
     }
@@ -32,4 +42,15 @@
     public void setTreeModified(Timestamp treeModified) {
         this.treeModified = treeModified;
     }
+
+    public Timestamp getParentModified() {
+        if (this.parentModified == null && this.probe != null) {
+            return this.probe.getTreeModified();
+        }
+        return this.parentModified;
+    }
+
+    public void setParentModified(Timestamp parentModified) {
+        this.parentModified = parentModified;
+    }
 }
--- a/src/main/java/de/intevation/lada/model/land/LProbe.java	Wed Mar 25 16:26:46 2015 +0100
+++ b/src/main/java/de/intevation/lada/model/land/LProbe.java	Wed Apr 08 10:41:33 2015 +0200
@@ -55,7 +55,7 @@
     @Column(name="solldatum_ende")
     private Timestamp solldatumEnde;
 
-    @Column(name="tree_modified")
+    @Column(name="tree_modified", insertable=false, updatable=false)
     private Timestamp treeModified;
 
     @Transient
--- a/src/main/java/de/intevation/lada/model/land/LStatus.java	Wed Mar 25 16:26:46 2015 +0100
+++ b/src/main/java/de/intevation/lada/model/land/LStatus.java	Wed Apr 08 10:41:33 2015 +0200
@@ -11,7 +11,10 @@
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
 import javax.persistence.Table;
+import javax.persistence.Transient;
 
 
 /**
@@ -22,9 +25,16 @@
 public class LStatus extends de.intevation.lada.model.Status {
     private static final long serialVersionUID = 1L;
 
-    @Column(name="tree_modified")
+    @Column(name="tree_modified", insertable=false, updatable=false)
     private Timestamp treeModified;
 
+    @OneToOne
+    @JoinColumn(name="messungs_id", insertable=false, updatable=false)
+    private LMessung messung;
+
+    @Transient
+    private Timestamp parentModified;
+
     public Timestamp getTreeModified() {
         return treeModified;
     }
@@ -32,4 +42,15 @@
     public void setTreeModified(Timestamp treeModified) {
         this.treeModified = treeModified;
     }
+
+    public Timestamp getParentModified() {
+        if (this.parentModified == null && this.messung != null) {
+            return this.messung.getTreeModified();
+        }
+        return this.parentModified;
+    }
+
+    public void setParentModified(Timestamp parentModified) {
+        this.parentModified = parentModified;
+    }
 }
--- a/src/main/java/de/intevation/lada/model/land/LZusatzWert.java	Wed Mar 25 16:26:46 2015 +0100
+++ b/src/main/java/de/intevation/lada/model/land/LZusatzWert.java	Wed Apr 08 10:41:33 2015 +0200
@@ -11,7 +11,10 @@
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
 import javax.persistence.Table;
+import javax.persistence.Transient;
 
 
 /**
@@ -22,9 +25,16 @@
 public class LZusatzWert extends de.intevation.lada.model.ZusatzWert {
     private static final long serialVersionUID = 1L;
 
-    @Column(name="tree_modified")
+    @Column(name="tree_modified", insertable=false, updatable=false)
     private Timestamp treeModified;
 
+    @OneToOne
+    @JoinColumn(name="probe_id", insertable=false, updatable=false)
+    private LProbe probe;
+
+    @Transient
+    private Timestamp parentModified;
+
     public Timestamp getTreeModified() {
         return treeModified;
     }
@@ -32,4 +42,15 @@
     public void setTreeModified(Timestamp treeModified) {
         this.treeModified = treeModified;
     }
+
+    public Timestamp getParentModified() {
+        if (this.parentModified == null && this.probe != null) {
+            return this.probe.getTreeModified();
+        }
+        return this.parentModified;
+    }
+
+    public void setParentModified(Timestamp parentModified) {
+        this.parentModified = parentModified;
+    }
 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)