Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/BedHeight.java @ 9211:aca5a7a57a3a
SINFO-TKH: definition der standard sohlhöhen jetzt mit Gültigkeitsstrecke. Definitionsdateien aufgeteilt in eine pro Gewässer.
author | gernotbelger |
---|---|
date | Tue, 03 Jul 2018 13:09:46 +0200 |
parents | 32dd7e761e4e |
children | 13b764afb536 |
comparison
equal
deleted
inserted
replaced
9210:de55d9a94796 | 9211:aca5a7a57a3a |
---|---|
241 final List<BedHeight> singles = query.list(); | 241 final List<BedHeight> singles = query.list(); |
242 | 242 |
243 return ((singles != null) && !singles.isEmpty()) ? singles.get(0) : null; | 243 return ((singles != null) && !singles.isEmpty()) ? singles.get(0) : null; |
244 } | 244 } |
245 | 245 |
246 public static BedHeight getBedHeightByDescription(final River river, final String description) { | 246 // TODO Do km range filtering in SQL statement |
247 public static BedHeight getBedHeightByDescription(final River river, final String description, final double startKm, final double endKm) { | |
247 | 248 |
248 final Session session = SessionHolder.HOLDER.get(); | 249 final Session session = SessionHolder.HOLDER.get(); |
249 | 250 |
250 final Query query = session.createQuery("FROM BedHeight WHERE (trim(description)=:description) AND river=:river"); | 251 final Query query = session.createQuery("FROM BedHeight WHERE (trim(description)=:description) AND river=:river"); |
251 query.setParameter("river", river); | 252 query.setParameter("river", river); |
254 final List<BedHeight> singles = query.list(); | 255 final List<BedHeight> singles = query.list(); |
255 | 256 |
256 return ((singles != null) && !singles.isEmpty()) ? singles.get(0) : null; | 257 return ((singles != null) && !singles.isEmpty()) ? singles.get(0) : null; |
257 } | 258 } |
258 } | 259 } |
259 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |