diff src/main/java/de/intevation/lada/model/land/Messung.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 61354a9fa58d
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/model/land/Messung.java	Wed Aug 31 15:47:52 2016 +0200
+++ b/src/main/java/de/intevation/lada/model/land/Messung.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;
 
 
@@ -46,6 +48,10 @@
     @Column(name="probe_id")
     private Integer probeId;
 
+    @OneToOne
+    @JoinColumn(name="probe_id", insertable=false, updatable=false)
+    private Probe probe;
+
     private Integer status;
 
     @Column(name="tree_modified")
@@ -180,6 +186,9 @@
      * @return the parentModified
      */
     public Timestamp getParentModified() {
+        if (this.parentModified == null && this.probe != null) {
+            return this.probe.getTreeModified();
+        }
         return parentModified;
     }
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)