Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/Catchment.java @ 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 |
comparison
equal
deleted
inserted
replaced
2864:bb116a8d6e19 | 2865:a6ef300748c4 |
---|---|
91 public void setGeom(Geometry geom) { | 91 public void setGeom(Geometry geom) { |
92 this.geom = geom; | 92 this.geom = geom; |
93 } | 93 } |
94 | 94 |
95 | 95 |
96 public static List<Catchment> getCatchments(int riverId) { | 96 public static List<Catchment> getCatchments(int riverId, String name) { |
97 Session session = SessionHolder.HOLDER.get(); | 97 Session session = SessionHolder.HOLDER.get(); |
98 | 98 |
99 Query query = session.createQuery( | 99 Query query = session.createQuery( |
100 "from Catchment where river.id =:river_id"); | 100 "from Catchment where river.id =:river_id AND name=:name"); |
101 query.setParameter("river_id", riverId); | 101 query.setParameter("river_id", riverId); |
102 query.setParameter("name", name); | |
102 | 103 |
103 return query.list(); | 104 return query.list(); |
104 } | 105 } |
105 } | 106 } |
106 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 107 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |