# HG changeset patch # User Sascha L. Teichmann # Date 1347270643 0 # Node ID 6546c0bbc6f9373e602117758cdc49af726b8b7f # Parent 9f92c42b7a813db0963fd60998af078e97b07ad5 Backend: 'Pegelinfo' needs min/max Q, too. flys-backend/trunk@5417 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 9f92c42b7a81 -r 6546c0bbc6f9 flys-backend/ChangeLog --- a/flys-backend/ChangeLog Mon Sep 10 08:20:50 2012 +0000 +++ b/flys-backend/ChangeLog Mon Sep 10 09:50:43 2012 +0000 @@ -1,3 +1,8 @@ +2012-09-10 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/model/Gauge.java: + We need min/max Q, too. + 2012-09-10 Björn Ricks * src/main/java/de/intevation/flys/model/MinMaxWQ.java, diff -r 9f92c42b7a81 -r 6546c0bbc6f9 flys-backend/src/main/java/de/intevation/flys/model/Gauge.java --- a/flys-backend/src/main/java/de/intevation/flys/model/Gauge.java Mon Sep 10 08:20:50 2012 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/model/Gauge.java Mon Sep 10 09:50:43 2012 +0000 @@ -297,26 +297,25 @@ "from MainValue as mv " + "join mv.mainValue as nmv " + "join nmv.type mvt " + - "where mvt.name = 'W' and mv.gauge.id = :gauge_id " + + "where mvt.name in ('W', 'Q') " + + "and mv.gauge.id = :gauge_id " + "group by mvt.name order by mvt.name" ); query.setParameter("gauge_id", getId()); List results = query.list(); - if (results.size() == 0) { + if (results.isEmpty()) { // No values found return new MinMaxWQ(); } - BigDecimal maxw; - BigDecimal minw; + Object[] arr = (Object[]) results.get(0); + BigDecimal maxw = (BigDecimal)arr[0]; + BigDecimal minw = (BigDecimal)arr[1]; BigDecimal maxq = null; BigDecimal minq = null; - Object[] arr = (Object[]) results.get(0); - maxw = (BigDecimal)arr[0]; - minw = (BigDecimal)arr[1]; if (results.size() > 1) { arr = (Object[]) results.get(1);