Mercurial > dive4elements > river
changeset 9089:02e4a0d983c0
Fixed :bed heights finder did not consider the river correctly
author | gernotbelger |
---|---|
date | Fri, 25 May 2018 10:49:42 +0200 |
parents | 7e60457f9d26 |
children | 8c15c3c23ecc |
files | backend/src/main/java/org/dive4elements/river/model/BedHeight.java |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/model/BedHeight.java Fri May 25 10:49:23 2018 +0200 +++ b/backend/src/main/java/org/dive4elements/river/model/BedHeight.java Fri May 25 10:49:42 2018 +0200 @@ -243,11 +243,12 @@ return singles != null ? singles.get(0) : null; } - public static BedHeight getBedHeightByDescription(final String description) { + public static BedHeight getBedHeightByDescription(final River river, final String description) { final Session session = SessionHolder.HOLDER.get(); - final Query query = session.createQuery("FROM BedHeight WHERE (trim(description)=:description)"); + final Query query = session.createQuery("FROM BedHeight WHERE (trim(description)=:description) AND river=:river"); + query.setParameter("river", river); query.setParameter("description", description); final List<BedHeight> singles = query.list();