Mercurial > lada > lada-server
changeset 575:4f83f2fc188a
Updated model classes to have getter/setter for owner and readonly flags.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Mon, 23 Mar 2015 17:42:16 +0100 |
parents | b0d674240c29 |
children | 1e3408f09ead |
files | src/main/java/de/intevation/lada/model/KommentarM.java src/main/java/de/intevation/lada/model/KommentarP.java src/main/java/de/intevation/lada/model/Messung.java src/main/java/de/intevation/lada/model/Messwert.java src/main/java/de/intevation/lada/model/Ort.java src/main/java/de/intevation/lada/model/Status.java src/main/java/de/intevation/lada/model/ZusatzWert.java src/main/java/de/intevation/lada/model/land/LProbe.java |
diffstat | 8 files changed, 192 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/model/KommentarM.java Thu Mar 19 14:28:44 2015 +0100 +++ b/src/main/java/de/intevation/lada/model/KommentarM.java Mon Mar 23 17:42:16 2015 +0100 @@ -16,6 +16,7 @@ import javax.persistence.Id; import javax.persistence.MappedSuperclass; import javax.persistence.Table; +import javax.persistence.Transient; /** @@ -40,6 +41,12 @@ private String text; + @Transient + private boolean owner; + + @Transient + private boolean readonly; + public KommentarM() { } @@ -75,6 +82,22 @@ this.text = text; } + public boolean isOwner() { + return owner; + } + + public void setOwner(boolean owner) { + this.owner = owner; + } + + public boolean isReadonly() { + return readonly; + } + + public void setReadonly(boolean readonly) { + this.readonly = readonly; + } + public Integer getMessungsId() { return this.messungsId; }
--- a/src/main/java/de/intevation/lada/model/KommentarP.java Thu Mar 19 14:28:44 2015 +0100 +++ b/src/main/java/de/intevation/lada/model/KommentarP.java Mon Mar 23 17:42:16 2015 +0100 @@ -16,6 +16,7 @@ import javax.persistence.Id; import javax.persistence.MappedSuperclass; import javax.persistence.Table; +import javax.persistence.Transient; /** @@ -40,6 +41,12 @@ @Column(name="probe_id") private Integer probeId; + @Transient + private boolean owner; + + @Transient + private boolean readonly; + public KommentarP() { } @@ -82,4 +89,20 @@ public void setProbeId(Integer probeId) { this.probeId = probeId; } + + public boolean isOwner() { + return owner; + } + + public void setOwner(boolean owner) { + this.owner = owner; + } + + public boolean isReadonly() { + return readonly; + } + + public void setReadonly(boolean readonly) { + this.readonly = readonly; + } }
--- a/src/main/java/de/intevation/lada/model/Messung.java Thu Mar 19 14:28:44 2015 +0100 +++ b/src/main/java/de/intevation/lada/model/Messung.java Mon Mar 23 17:42:16 2015 +0100 @@ -16,6 +16,7 @@ import javax.persistence.Id; import javax.persistence.MappedSuperclass; import javax.persistence.Table; +import javax.persistence.Transient; /** @@ -46,6 +47,12 @@ @Column(name="probe_id") private Integer probeId; + @Transient + private boolean owner; + + @Transient + private boolean readonly; + public Messung() { } @@ -104,4 +111,20 @@ public void setProbeId(Integer probeId) { this.probeId = probeId; } + + public boolean isOwner() { + return owner; + } + + public void setOwner(boolean owner) { + this.owner = owner; + } + + public boolean isReadonly() { + return readonly; + } + + public void setReadonly(boolean readonly) { + this.readonly = readonly; + } }
--- a/src/main/java/de/intevation/lada/model/Messwert.java Thu Mar 19 14:28:44 2015 +0100 +++ b/src/main/java/de/intevation/lada/model/Messwert.java Mon Mar 23 17:42:16 2015 +0100 @@ -16,6 +16,7 @@ import javax.persistence.Id; import javax.persistence.MappedSuperclass; import javax.persistence.Table; +import javax.persistence.Transient; /** @@ -55,6 +56,12 @@ @Column(name="nwg_zu_messwert") private Float nwgZuMesswert; + @Transient + private boolean owner; + + @Transient + private boolean readonly; + public Messwert() { } @@ -138,4 +145,20 @@ this.nwgZuMesswert = nwgZuMesswert; } + public boolean isOwner() { + return owner; + } + + public void setOwner(boolean owner) { + this.owner = owner; + } + + public boolean isReadonly() { + return readonly; + } + + public void setReadonly(boolean readonly) { + this.readonly = readonly; + } + }
--- a/src/main/java/de/intevation/lada/model/Ort.java Thu Mar 19 14:28:44 2015 +0100 +++ b/src/main/java/de/intevation/lada/model/Ort.java Mon Mar 23 17:42:16 2015 +0100 @@ -17,6 +17,7 @@ import javax.persistence.Id; import javax.persistence.MappedSuperclass; import javax.persistence.Table; +import javax.persistence.Transient; /** @@ -46,6 +47,12 @@ @Column(name="ort_id") private BigInteger ort; + @Transient + private boolean owner; + + @Transient + private boolean readonly; + public Ort() { } @@ -96,4 +103,20 @@ public void setOrt(BigInteger ort) { this.ort = ort; } + + public boolean isOwner() { + return owner; + } + + public void setOwner(boolean owner) { + this.owner = owner; + } + + public boolean isReadonly() { + return readonly; + } + + public void setReadonly(boolean readonly) { + this.readonly = readonly; + } }
--- a/src/main/java/de/intevation/lada/model/Status.java Thu Mar 19 14:28:44 2015 +0100 +++ b/src/main/java/de/intevation/lada/model/Status.java Mon Mar 23 17:42:16 2015 +0100 @@ -8,9 +8,16 @@ package de.intevation.lada.model; import java.io.Serializable; -import javax.persistence.*; import java.sql.Timestamp; +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.MappedSuperclass; +import javax.persistence.Table; +import javax.persistence.Transient; + /** * The persistent class for the status database table. @@ -38,6 +45,12 @@ private Integer status; + @Transient + private boolean owner; + + @Transient + private boolean readonly; + public Status() { } @@ -88,4 +101,20 @@ public void setStatus(Integer status) { this.status = status; } + + public boolean isOwner() { + return owner; + } + + public void setOwner(boolean owner) { + this.owner = owner; + } + + public boolean isReadonly() { + return readonly; + } + + public void setReadonly(boolean readonly) { + this.readonly = readonly; + } }
--- a/src/main/java/de/intevation/lada/model/ZusatzWert.java Thu Mar 19 14:28:44 2015 +0100 +++ b/src/main/java/de/intevation/lada/model/ZusatzWert.java Mon Mar 23 17:42:16 2015 +0100 @@ -8,9 +8,16 @@ package de.intevation.lada.model; import java.io.Serializable; -import javax.persistence.*; import java.sql.Timestamp; +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.MappedSuperclass; +import javax.persistence.Table; +import javax.persistence.Transient; + /** * The persistent class for the zusatz_wert database table. @@ -42,6 +49,12 @@ @Column(name="pzs_id") private String pzsId; + @Transient + private boolean owner; + + @Transient + private boolean readonly; + public ZusatzWert() { } @@ -101,4 +114,20 @@ this.pzsId = pzsId; } + public boolean isOwner() { + return owner; + } + + public void setOwner(boolean owner) { + this.owner = owner; + } + + public boolean isReadonly() { + return readonly; + } + + public void setReadonly(boolean readonly) { + this.readonly = readonly; + } + }
--- a/src/main/java/de/intevation/lada/model/land/LProbe.java Thu Mar 19 14:28:44 2015 +0100 +++ b/src/main/java/de/intevation/lada/model/land/LProbe.java Mon Mar 23 17:42:16 2015 +0100 @@ -13,6 +13,7 @@ import javax.persistence.Entity; import javax.persistence.OneToOne; import javax.persistence.Table; +import javax.persistence.Transient; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -54,6 +55,12 @@ @Column(name="solldatum_ende") private Timestamp solldatumEnde; + @Transient + private boolean readonly; + + @Transient + private boolean owner; + public LProbe() { } @@ -142,10 +149,18 @@ public void setProbeIdAlt(String probeIdAlt) {} public boolean getIsOwner() { - return true; //TODO set a valid value in authorization process. + return this.owner; //TODO set a valid value in authorization process. + } + + public void setIsOwner(boolean value) { + this.owner = value; } public boolean getReadonly() { - return false; //TODO set a valid value in authorization process. + return this.readonly; //TODO set a valid value in authorization process. + } + + public void setReadonly(boolean value) { + this.readonly = value; } }