Mercurial > dive4elements > river
changeset 2865:a6ef300748c4
Modified Catchment.getCatchments() to retrieve specific catchments.
flys-backend/trunk@4358 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 08 May 2012 12:13:16 +0000 |
parents | bb116a8d6e19 |
children | 77e849c0d248 |
files | flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/model/Catchment.java |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-backend/ChangeLog Tue May 08 10:22:48 2012 +0000 +++ b/flys-backend/ChangeLog Tue May 08 12:13:16 2012 +0000 @@ -1,3 +1,9 @@ +2012-05-08 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/model/Catchment.java: The + getCatchments() function got a further parameter 'name' to retrieve + specific catchments only. + 2012-05-08 Ingo Weinzierl <ingo@intevation.de> * doc/schema/oracle-spatial_idx.sql: Set the geometry type of 'catchments'
--- a/flys-backend/src/main/java/de/intevation/flys/model/Catchment.java Tue May 08 10:22:48 2012 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/model/Catchment.java Tue May 08 12:13:16 2012 +0000 @@ -93,12 +93,13 @@ } - public static List<Catchment> getCatchments(int riverId) { + public static List<Catchment> getCatchments(int riverId, String name) { Session session = SessionHolder.HOLDER.get(); Query query = session.createQuery( - "from Catchment where river.id =:river_id"); + "from Catchment where river.id =:river_id AND name=:name"); query.setParameter("river_id", riverId); + query.setParameter("name", name); return query.list(); }