[Lada-commits] [PATCH 1 of 6] Added "parentModified" attribute to status protocol

Wald Commits scm-commit at wald.intevation.org
Tue Nov 3 09:24:37 CET 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1446454730 -3600
# Node ID 9d34aca4fb07852ff05e664629196a48c641bbd2
# Parent  5f6037a281fea2215bf8b154d920d09153feb3aa
Added "parentModified" attribute to status protocol.

diff -r 5f6037a281fe -r 9d34aca4fb07 src/main/java/de/intevation/lada/model/land/LStatusProtokoll.java
--- a/src/main/java/de/intevation/lada/model/land/LStatusProtokoll.java	Fri Oct 30 15:08:08 2015 +0100
+++ b/src/main/java/de/intevation/lada/model/land/LStatusProtokoll.java	Mon Nov 02 09:58:50 2015 +0100
@@ -7,8 +7,13 @@
  */
 package de.intevation.lada.model.land;
 
+import java.sql.Timestamp;
+
 import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
 import javax.persistence.Table;
+import javax.persistence.Transient;
 
 import de.intevation.lada.model.StatusProtokoll;
 
@@ -19,4 +24,22 @@
 @Table(name="status_protokoll")
 public class LStatusProtokoll extends StatusProtokoll {
     private static final long serialVersionUID = 1L;
+
+    @OneToOne
+    @JoinColumn(name="messungs_id", insertable=false, updatable=false)
+    private LMessung messung;
+
+    @Transient
+    private Timestamp parentModified;
+
+    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;
+    }
 }


More information about the Lada-commits mailing list