diff src/main/java/de/intevation/lada/model/land/Messwert.java @ 1033:812e0cace5ba schema-update

Added additional attributes to complete the model.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 31 Aug 2016 15:49:40 +0200
parents 1c41c7b8f7c2
children
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/model/land/Messwert.java	Wed Aug 31 15:47:52 2016 +0200
+++ b/src/main/java/de/intevation/lada/model/land/Messwert.java	Wed Aug 31 15:49:40 2016 +0200
@@ -8,6 +8,8 @@
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
 import javax.persistence.Transient;
 
 
@@ -50,6 +52,10 @@
     @Column(name="tree_modified")
     private Timestamp treeModified;
 
+    @OneToOne
+    @JoinColumn(name="messungs_id", insertable=false, updatable=false)
+    private Messung messung;
+
     @Transient
     private boolean owner;
 
@@ -178,18 +184,14 @@
         this.readonly = readonly;
     }
 
-    /**
-     * @return the parentModified
-     */
     public Timestamp getParentModified() {
-        return parentModified;
+        if (this.parentModified == null && this.messung != null) {
+            return this.messung.getTreeModified();
+        }
+        return this.parentModified;
     }
 
-    /**
-     * @param parentModified the parentModified to set
-     */
     public void setParentModified(Timestamp parentModified) {
         this.parentModified = parentModified;
     }
-
 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)