# HG changeset patch # User Raimund Renkert # Date 1428482493 -7200 # Node ID 8d238aa430e3a7cfe069579524fb1819ce86cc2a # Parent 31c4bd94d74eea170640379906199b0fcf64e23c Added new field to model classes to have the parent tree_modified timestamp available. diff -r 31c4bd94d74e -r 8d238aa430e3 src/main/java/de/intevation/lada/model/land/LMessung.java --- 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; } diff -r 31c4bd94d74e -r 8d238aa430e3 src/main/java/de/intevation/lada/model/land/LMesswert.java --- 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; + } } diff -r 31c4bd94d74e -r 8d238aa430e3 src/main/java/de/intevation/lada/model/land/LOrt.java --- 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; + } } diff -r 31c4bd94d74e -r 8d238aa430e3 src/main/java/de/intevation/lada/model/land/LProbe.java --- 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 diff -r 31c4bd94d74e -r 8d238aa430e3 src/main/java/de/intevation/lada/model/land/LStatus.java --- 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; + } } diff -r 31c4bd94d74e -r 8d238aa430e3 src/main/java/de/intevation/lada/model/land/LZusatzWert.java --- 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; + } }