Mercurial > lada > lada-server
changeset 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 | 1c6c83037b8c |
children | 61354a9fa58d |
files | src/main/java/de/intevation/lada/model/land/Messung.java src/main/java/de/intevation/lada/model/land/Messwert.java src/main/java/de/intevation/lada/model/land/Ortszuordnung.java src/main/java/de/intevation/lada/model/land/ZusatzWert.java |
diffstat | 4 files changed, 92 insertions(+), 8 deletions(-) [+] |
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; }
--- 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; } - }
--- 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; + } }
--- 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; + } }