[Lada-commits] [PATCH 2 of 7] Fixed model and its dependencies

Wald Commits scm-commit at wald.intevation.org
Mon Sep 5 10:20:03 CEST 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1472817723 -7200
# Branch schema-update
# Node ID 6f9983f6824863ebe1a47a139fff1da04c2f4e59
# Parent  cd16a41ca3abfd36231da7eb8a3949005f3375a7
Fixed model and its dependencies.

diff -r cd16a41ca3ab -r 6f9983f68248 src/main/java/de/intevation/lada/importer/laf/OrtCreator.java
--- a/src/main/java/de/intevation/lada/importer/laf/OrtCreator.java	Fri Sep 02 14:00:22 2016 +0200
+++ b/src/main/java/de/intevation/lada/importer/laf/OrtCreator.java	Fri Sep 02 14:02:03 2016 +0200
@@ -685,7 +685,7 @@
         }
         ort.setKoordXExtern(x);
         ort.setKoordYExtern(y);
-        ort.setKoordinatenArtId(Integer.valueOf(art));
+        ort.setKdaId(Integer.valueOf(art));
         return ort;
     }
 
@@ -730,7 +730,7 @@
         ort.setLongitude(Double.valueOf(x));
         ort.setKoordYExtern(y);
         ort.setLatitude(Double.valueOf(y));
-        ort.setKoordinatenArtId(Integer.valueOf(art));
+        ort.setKdaId(Integer.valueOf(art));
         return ort;
     }
 
diff -r cd16a41ca3ab -r 6f9983f68248 src/main/java/de/intevation/lada/model/land/Messprogramm.java
--- a/src/main/java/de/intevation/lada/model/land/Messprogramm.java	Fri Sep 02 14:00:22 2016 +0200
+++ b/src/main/java/de/intevation/lada/model/land/Messprogramm.java	Fri Sep 02 14:02:03 2016 +0200
@@ -1,3 +1,10 @@
+/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU GPL (v>=3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out
+ * the documentation coming with IMIS-Labordaten-Application for details.
+ */
 package de.intevation.lada.model.land;
 
 import java.io.Serializable;
@@ -23,7 +30,7 @@
     private Integer id;
 
     @Column(name="ba_id")
-    private String baId;
+    private Integer baId;
 
     @Column(name="datenbasis_id")
     private Integer datenbasisId;
@@ -90,11 +97,11 @@
         this.id = id;
     }
 
-    public String getBaId() {
+    public Integer getBaId() {
         return this.baId;
     }
 
-    public void setBaId(String baId) {
+    public void setBaId(Integer baId) {
         this.baId = baId;
     }
 
diff -r cd16a41ca3ab -r 6f9983f68248 src/main/java/de/intevation/lada/model/stammdaten/Ort.java
--- a/src/main/java/de/intevation/lada/model/stammdaten/Ort.java	Fri Sep 02 14:00:22 2016 +0200
+++ b/src/main/java/de/intevation/lada/model/stammdaten/Ort.java	Fri Sep 02 14:02:03 2016 +0200
@@ -82,7 +82,7 @@
     private String zustaendigkeit;
 
     @Column(name="kda_id")
-    private Integer koordinatenArt;
+    private Integer kdaId;
 
     @Transient
     private boolean readonly;
@@ -282,12 +282,12 @@
         this.zustaendigkeit = zustaendigkeit;
     }
 
-    public Integer getKoordinatenArtId() {
-        return this.koordinatenArt;
+    public Integer getKdaId() {
+        return this.kdaId;
     }
 
-    public void setKoordinatenArtId(Integer koordinatenArt) {
-        this.koordinatenArt = koordinatenArt;
+    public void setKdaId(Integer kdaId) {
+        this.kdaId = kdaId;
     }
 
     public boolean isReadonly() {
diff -r cd16a41ca3ab -r 6f9983f68248 src/main/java/de/intevation/lada/model/stammdaten/Verwaltungseinheit.java
--- a/src/main/java/de/intevation/lada/model/stammdaten/Verwaltungseinheit.java	Fri Sep 02 14:00:22 2016 +0200
+++ b/src/main/java/de/intevation/lada/model/stammdaten/Verwaltungseinheit.java	Fri Sep 02 14:02:03 2016 +0200
@@ -45,9 +45,9 @@
 
     private String kreis;
 
-    private double latitude;
+    private Double latitude;
 
-    private double longitude;
+    private Double longitude;
 
     private String nuts;
 
@@ -146,19 +146,19 @@
         this.kreis = kreis;
     }
 
-    public double getLatitude() {
+    public Double getLatitude() {
         return this.latitude;
     }
 
-    public void setLatitude(double latitude) {
+    public void setLatitude(Double latitude) {
         this.latitude = latitude;
     }
 
-    public double getLongitude() {
+    public Double getLongitude() {
         return this.longitude;
     }
 
-    public void setLongitude(double longitude) {
+    public void setLongitude(Double longitude) {
         this.longitude = longitude;
     }
 
diff -r cd16a41ca3ab -r 6f9983f68248 src/main/java/de/intevation/lada/rest/stamm/PflichtmessgroesseService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/PflichtmessgroesseService.java	Fri Sep 02 14:00:22 2016 +0200
+++ b/src/main/java/de/intevation/lada/rest/stamm/PflichtmessgroesseService.java	Fri Sep 02 14:02:03 2016 +0200
@@ -7,6 +7,8 @@
  */
 package de.intevation.lada.rest.stamm;
 
+import java.util.List;
+
 import javax.enterprise.context.RequestScoped;
 import javax.inject.Inject;
 import javax.ws.rs.GET;
@@ -101,7 +103,12 @@
                 defaultRepo.entityManager("stamm"),
                 PflichtMessgroesse.class
             );
-        builder.and("mmtId", id);
-        return defaultRepo.filter(builder.getQuery(), "stamm");
+        builder.and("messMethodeId", id);
+        List<PflichtMessgroesse> result =
+            defaultRepo.filterPlain(builder.getQuery(), "stamm");
+        if (!result.isEmpty()) {
+            return new Response(true, 200, result.get(0));
+        }
+        return new Response(false, 600, null);
     }
 }


More information about the Lada-commits mailing list