Mercurial > lada > lada-server
changeset 1038:6f9983f68248 schema-update
Fixed model and its dependencies.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 02 Sep 2016 14:02:03 +0200 |
parents | cd16a41ca3ab |
children | 7339dd0f8a67 |
files | src/main/java/de/intevation/lada/importer/laf/OrtCreator.java src/main/java/de/intevation/lada/model/land/Messprogramm.java src/main/java/de/intevation/lada/model/stammdaten/Ort.java src/main/java/de/intevation/lada/model/stammdaten/Verwaltungseinheit.java src/main/java/de/intevation/lada/rest/stamm/PflichtmessgroesseService.java |
diffstat | 5 files changed, 32 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- 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; }
--- 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; }
--- 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() {
--- 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; }
--- 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); } }