Mercurial > lada > lada-server
comparison src/main/java/de/intevation/lada/rest/stamm/PflichtmessgroesseService.java @ 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 | 1c41c7b8f7c2 |
children |
comparison
equal
deleted
inserted
replaced
1037:cd16a41ca3ab | 1038:6f9983f68248 |
---|---|
4 * This file is Free Software under the GNU GPL (v>=3) | 4 * This file is Free Software under the GNU GPL (v>=3) |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out | 5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
6 * the documentation coming with IMIS-Labordaten-Application for details. | 6 * the documentation coming with IMIS-Labordaten-Application for details. |
7 */ | 7 */ |
8 package de.intevation.lada.rest.stamm; | 8 package de.intevation.lada.rest.stamm; |
9 | |
10 import java.util.List; | |
9 | 11 |
10 import javax.enterprise.context.RequestScoped; | 12 import javax.enterprise.context.RequestScoped; |
11 import javax.inject.Inject; | 13 import javax.inject.Inject; |
12 import javax.ws.rs.GET; | 14 import javax.ws.rs.GET; |
13 import javax.ws.rs.Path; | 15 import javax.ws.rs.Path; |
99 QueryBuilder<PflichtMessgroesse> builder = | 101 QueryBuilder<PflichtMessgroesse> builder = |
100 new QueryBuilder<PflichtMessgroesse>( | 102 new QueryBuilder<PflichtMessgroesse>( |
101 defaultRepo.entityManager("stamm"), | 103 defaultRepo.entityManager("stamm"), |
102 PflichtMessgroesse.class | 104 PflichtMessgroesse.class |
103 ); | 105 ); |
104 builder.and("mmtId", id); | 106 builder.and("messMethodeId", id); |
105 return defaultRepo.filter(builder.getQuery(), "stamm"); | 107 List<PflichtMessgroesse> result = |
108 defaultRepo.filterPlain(builder.getQuery(), "stamm"); | |
109 if (!result.isEmpty()) { | |
110 return new Response(true, 200, result.get(0)); | |
111 } | |
112 return new Response(false, 600, null); | |
106 } | 113 } |
107 } | 114 } |