[Lada-commits] [PATCH 2 of 9] Fixed and completed ort and ortzuordnung model

Wald Commits scm-commit at wald.intevation.org
Fri Dec 18 18:01:42 CET 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1450456480 -3600
# Node ID e49494d974370a8d8edf041c2778c690922861d0
# Parent  6e5a0edba3631fd1efdfd3214a7e38f031f128e7
Fixed and completed ort and ortzuordnung model.

diff -r 6e5a0edba363 -r e49494d97437 src/main/java/de/intevation/lada/model/Ortszuordnung.java
--- a/src/main/java/de/intevation/lada/model/Ortszuordnung.java	Fri Dec 18 17:32:30 2015 +0100
+++ b/src/main/java/de/intevation/lada/model/Ortszuordnung.java	Fri Dec 18 17:34:40 2015 +0100
@@ -4,9 +4,12 @@
 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;
 
 
 /**
@@ -18,6 +21,8 @@
     private static final long serialVersionUID = 1L;
 
     @Id
+    @GeneratedValue(strategy=GenerationType.IDENTITY)
+    @Column(name="id", unique=true, nullable=false)
     private Integer id;
 
     @Column(name="letzte_aenderung")
@@ -34,6 +39,12 @@
     @Column(name="probe_id")
     private Integer probeId;
 
+    @Transient
+    private boolean owner;
+
+    @Transient
+    private boolean readonly;
+
     public Ortszuordnung() {
     }
 
@@ -85,4 +96,20 @@
         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;
+    }
+
 }
diff -r 6e5a0edba363 -r e49494d97437 src/main/java/de/intevation/lada/model/land/LOrtszuordnung.java
--- a/src/main/java/de/intevation/lada/model/land/LOrtszuordnung.java	Fri Dec 18 17:32:30 2015 +0100
+++ b/src/main/java/de/intevation/lada/model/land/LOrtszuordnung.java	Fri Dec 18 17:34:40 2015 +0100
@@ -4,7 +4,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;
 
 
 /**
@@ -15,9 +18,16 @@
 public class LOrtszuordnung extends de.intevation.lada.model.Ortszuordnung {
     private static final long serialVersionUID = 1L;
 
+    @OneToOne
+    @JoinColumn(name="probe_id", insertable=false, updatable=false)
+    private LProbe probe;
+
     @Column(name="tree_modified")
     private Timestamp treeModified;
 
+    @Transient
+    private Timestamp parentModified;
+
     public LOrtszuordnung() {
     }
 
@@ -28,4 +38,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 6e5a0edba363 -r e49494d97437 src/main/java/de/intevation/lada/model/stamm/Ort.java
--- a/src/main/java/de/intevation/lada/model/stamm/Ort.java	Fri Dec 18 17:32:30 2015 +0100
+++ b/src/main/java/de/intevation/lada/model/stamm/Ort.java	Fri Dec 18 17:34:40 2015 +0100
@@ -32,7 +32,7 @@
     private String gemId;
 
     @Column(name="hoehe_land")
-    private float hoeheLand;
+    private Float hoeheLand;
 
     @Column(name="kda_id")
     private Integer kdaId;
@@ -47,12 +47,12 @@
 
     private String langtext;
 
-    private double latitude;
+    private Double latitude;
 
     @Column(name="letzte_aenderung")
     private Timestamp letzteAenderung;
 
-    private double longitude;
+    private Double longitude;
 
     @Column(name="mp_art")
     private String mpArt;
@@ -126,11 +126,11 @@
         this.gemId = gemId;
     }
 
-    public float getHoeheLand() {
+    public Float getHoeheLand() {
         return this.hoeheLand;
     }
 
-    public void setHoeheLand(float hoeheLand) {
+    public void setHoeheLand(Float hoeheLand) {
         this.hoeheLand = hoeheLand;
     }
 
@@ -174,11 +174,11 @@
         this.langtext = langtext;
     }
 
-    public double getLatitude() {
+    public Double getLatitude() {
         return this.latitude;
     }
 
-    public void setLatitude(double latitude) {
+    public void setLatitude(Double latitude) {
         this.latitude = latitude;
     }
 
@@ -190,11 +190,11 @@
         this.letzteAenderung = letzteAenderung;
     }
 
-    public double getLongitude() {
+    public Double getLongitude() {
         return this.longitude;
     }
 
-    public void setLongitude(double longitude) {
+    public void setLongitude(Double longitude) {
         this.longitude = longitude;
     }
 


More information about the Lada-commits mailing list