changeset 3308:5ccd51ca11ce

SQ relation: Fixed problem with string operation precedence. flys-artifacts/trunk@4997 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 13 Jul 2012 14:25:16 +0000
parents 81a98f360553
children fd3243d892a9
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/MeasurementFactory.java
diffstat 2 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Fri Jul 13 13:43:26 2012 +0000
+++ b/flys-artifacts/ChangeLog	Fri Jul 13 14:25:16 2012 +0000
@@ -1,9 +1,17 @@
+<<<<<<< .mine
+2012-07-13	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/sq/MeasurementFactory.java:
+	  Fixed problem with string operation precedence.
+
+=======
 2012-07-13	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* doc/conf/meta-data.xml: very basic official lines matching the current
 	  artifact (for this it is wrongly placed in previous calc.-part, for
 	  now.
 
+>>>>>>> .r4996
 2012-07-13	Christian Lins	<christian.lins@intevation.de>
 
 	* src/main/java/de/intevation/flys/utils/MapfileGenerator.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/MeasurementFactory.java	Fri Jul 13 13:43:26 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/MeasurementFactory.java	Fri Jul 13 14:25:16 2012 +0000
@@ -40,7 +40,7 @@
     };
 
     public static final String SQL_MEASSURE =
-        "SELECT " +
+        ("SELECT " +
             "m.TSAND   AS TSAND,"   +
             "m.TSCHWEB AS TSCHWEB," +
             "m.CSCHWEB AS CSCHWEB," +
@@ -56,7 +56,7 @@
                 "g.name = :river_name AND " +
                 "s.km BETWEEN :location - 0.001 AND :location + 0.001 AND " +
                 "m.datum BETWEEN :from AND :to AND " +
-                "m.Q IS NOT NULL"
+                "m.Q IS NOT NULL")
         .replace("%GSIEBSATZ%", projection("gs", GSIEBSATZ))
         .replace("%SSIEBUNG%",  projection("ss", SSIEBUNG));
 
@@ -106,6 +106,12 @@
         double    location,
         DateRange dateRange
     ) {
+        boolean debug = log.isDebugEnabled();
+
+        if (debug) {
+            log.debug(SQL_MEASSURE);
+        }
+
         SQLQuery query = session.createSQLQuery(SQL_MEASSURE)
             .addScalar("TSAND",   StandardBasicTypes.DOUBLE)
             .addScalar("TSCHWEB", StandardBasicTypes.DOUBLE)

http://dive4elements.wald.intevation.org