diff backend/src/main/java/org/dive4elements/river/importer/ImportPorosityValue.java @ 7862:cdef048c4ac5

Fixed porosity importer. Find existing db entries and parse values from string, not via double.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 08 May 2014 13:48:45 +0200
parents 02711de579cc
children 5e38e2924c07
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/ImportPorosityValue.java	Thu May 08 13:46:32 2014 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/ImportPorosityValue.java	Thu May 08 13:48:45 2014 +0200
@@ -67,15 +67,13 @@
             Query query = session.createQuery(
                 "from PorosityValue where " +
                 "   porosity=:porosity and " +
-                "   station=:station and " +
-                "   shoreOffset=:shoreOffset and " +
-                "   porosityValue=:poros and " +
+                "   station between :station - 0.0001f and :station + 0.0001f and" +
+                "   porosityValue between :poros -0.0001f and :poros + 0.0001f and" +
                 "   description=:description");
 
             query.setParameter("porosity", porosity);
-            query.setParameter("station", station);
-            query.setParameter("shoreOffset", shoreOffset);
-            query.setParameter("poros", this.porosity);
+            query.setParameter("station", station.floatValue());
+            query.setParameter("poros", this.porosity.floatValue());
             query.setParameter("description", description);
 
             List<PorosityValue> values = query.list();

http://dive4elements.wald.intevation.org