comparison backend/src/main/java/org/dive4elements/river/importer/ImportDepth.java @ 7861:c288309a5dcb

Fixed getPeer for depth. Select with a small epsilon, not extact match.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 08 May 2014 13:46:32 +0200
parents 4c3ccf2b0304
children 5e38e2924c07
comparison
equal deleted inserted replaced
7860:f4dffc7d1d60 7861:c288309a5dcb
50 if (peer == null) { 50 if (peer == null) {
51 Session session = ImporterSession.getInstance().getDatabaseSession(); 51 Session session = ImporterSession.getInstance().getDatabaseSession();
52 52
53 Query query = session.createQuery( 53 Query query = session.createQuery(
54 "from Depth where " + 54 "from Depth where " +
55 " lower=:lower and " + 55 " lower between :lower - 0.0001f and :lower + 0.00001f and " +
56 " upper=:upper"); 56 " upper between :upper - 0.0001f and :upper + 0.00001f");
57 57
58 query.setParameter("lower", lower); 58 query.setParameter("lower", lower.floatValue());
59 query.setParameter("upper", upper); 59 query.setParameter("upper", upper.floatValue());
60 60
61 List<Depth> depths = query.list(); 61 List<Depth> depths = query.list();
62 62
63 if (depths.isEmpty()) { 63 if (depths.isEmpty()) {
64 log.debug("Create new Depth DB instance."); 64 log.debug("Create new Depth DB instance.");

http://dive4elements.wald.intevation.org