Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
7861:c288309a5dcb | 7862:cdef048c4ac5 |
---|---|
65 Session session = ImporterSession.getInstance().getDatabaseSession(); | 65 Session session = ImporterSession.getInstance().getDatabaseSession(); |
66 | 66 |
67 Query query = session.createQuery( | 67 Query query = session.createQuery( |
68 "from PorosityValue where " + | 68 "from PorosityValue where " + |
69 " porosity=:porosity and " + | 69 " porosity=:porosity and " + |
70 " station=:station and " + | 70 " station between :station - 0.0001f and :station + 0.0001f and" + |
71 " shoreOffset=:shoreOffset and " + | 71 " porosityValue between :poros -0.0001f and :poros + 0.0001f and" + |
72 " porosityValue=:poros and " + | |
73 " description=:description"); | 72 " description=:description"); |
74 | 73 |
75 query.setParameter("porosity", porosity); | 74 query.setParameter("porosity", porosity); |
76 query.setParameter("station", station); | 75 query.setParameter("station", station.floatValue()); |
77 query.setParameter("shoreOffset", shoreOffset); | 76 query.setParameter("poros", this.porosity.floatValue()); |
78 query.setParameter("poros", this.porosity); | |
79 query.setParameter("description", description); | 77 query.setParameter("description", description); |
80 | 78 |
81 List<PorosityValue> values = query.list(); | 79 List<PorosityValue> values = query.list(); |
82 if (values.isEmpty()) { | 80 if (values.isEmpty()) { |
83 log.debug("Create new PorosityValue DB instance."); | 81 log.debug("Create new PorosityValue DB instance."); |