diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/GaugeFinderFactory.java @ 3421:c44ff50f4970

FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings. flys-artifacts/trunk@5075 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 19 Jul 2012 21:12:57 +0000
parents 368d1837ce5d
children 61f4d4164a30
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/GaugeFinderFactory.java	Thu Jul 19 16:57:44 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/GaugeFinderFactory.java	Thu Jul 19 21:12:57 2012 +0000
@@ -28,6 +28,7 @@
     public static final String SQL_GAUGES =
         "SELECT" +
         "    g.id AS gauge_id," +
+        "    g.name AS name," +
         "    r.a  AS a," +
         "    r.b  AS b " +
         "FROM gauges g" +
@@ -89,6 +90,7 @@
     ) {
         SQLQuery query = session.createSQLQuery(SQL_GAUGES)
             .addScalar("gauge_id", StandardBasicTypes.INTEGER)
+            .addScalar("name",     StandardBasicTypes.STRING)
             .addScalar("a",        StandardBasicTypes.DOUBLE)
             .addScalar("b",        StandardBasicTypes.DOUBLE);
 
@@ -105,9 +107,10 @@
 
         for (Object [] row: list) {
             int    gaugeId = (Integer)row[0];
-            double start   = (Double) row[1];
-            double end     = (Double) row[2];
-            GaugeRange gauge = new GaugeRange(start, end, gaugeId);
+            String name    = (String) row[1];
+            double start   = (Double) row[2];
+            double end     = (Double) row[3];
+            GaugeRange gauge = new GaugeRange(start, end, name, gaugeId);
             gauges.add(gauge);
         }
 

http://dive4elements.wald.intevation.org