[Lada-commits] [PATCH 3 of 6] Added additional attributes to complete the model
Wald Commits
scm-commit at wald.intevation.org
Wed Aug 31 16:24:11 CEST 2016
# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1472651380 -7200
# Branch schema-update
# Node ID 812e0cace5baf680e08f1223a892af3919d69b86
# Parent 1c6c83037b8c0383989468158e29423617d5dc95
Added additional attributes to complete the model.
diff -r 1c6c83037b8c -r 812e0cace5ba src/main/java/de/intevation/lada/model/land/Messung.java
--- 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;
}
diff -r 1c6c83037b8c -r 812e0cace5ba src/main/java/de/intevation/lada/model/land/Messwert.java
--- 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;
}
-
}
diff -r 1c6c83037b8c -r 812e0cace5ba src/main/java/de/intevation/lada/model/land/Ortszuordnung.java
--- a/src/main/java/de/intevation/lada/model/land/Ortszuordnung.java Wed Aug 31 15:47:52 2016 +0200
+++ b/src/main/java/de/intevation/lada/model/land/Ortszuordnung.java Wed Aug 31 15:49:40 2016 +0200
@@ -8,6 +8,9 @@
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Transient;
/**
@@ -39,6 +42,19 @@
@Column(name="tree_modified")
private Timestamp treeModified;
+ @OneToOne
+ @JoinColumn(name="probe_id", insertable=false, updatable=false)
+ private Probe probe;
+
+ @Transient
+ private boolean owner;
+
+ @Transient
+ private boolean readonly;
+
+ @Transient
+ private Timestamp parentModified;
+
public Ortszuordnung() {
}
@@ -98,4 +114,42 @@
this.treeModified = treeModified;
}
+ /**
+ * @return the owner
+ */
+ public boolean isOwner() {
+ return owner;
+ }
+
+ /**
+ * @param owner the owner to set
+ */
+ public void setOwner(boolean owner) {
+ this.owner = owner;
+ }
+
+ /**
+ * @return the readonly
+ */
+ public boolean isReadonly() {
+ return readonly;
+ }
+
+ /**
+ * @param readonly the readonly to set
+ */
+ public void setReadonly(boolean readonly) {
+ this.readonly = readonly;
+ }
+
+ 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 1c6c83037b8c -r 812e0cace5ba src/main/java/de/intevation/lada/model/land/ZusatzWert.java
--- a/src/main/java/de/intevation/lada/model/land/ZusatzWert.java Wed Aug 31 15:47:52 2016 +0200
+++ b/src/main/java/de/intevation/lada/model/land/ZusatzWert.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.Table;
import javax.persistence.Transient;
@@ -45,12 +47,19 @@
@Column(name="tree_modified")
private Timestamp treeModified;
+ @OneToOne
+ @JoinColumn(name="probe_id", insertable=false, updatable=false)
+ private Probe probe;
+
@Transient
private boolean owner;
@Transient
private boolean readonly;
+ @Transient
+ private Timestamp parentModified;
+
public ZusatzWert() {
}
@@ -146,4 +155,14 @@
this.readonly = readonly;
}
+ 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;
+ }
}
More information about the Lada-commits
mailing list