Mercurial > dive4elements > river
changeset 5090:2878b816e945 dami
Add getLines method to get a list of HWSLine elements
Patch provided by Raimund Renkert <rrenkert@intevation.de>
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 25 Feb 2013 12:13:22 +0100 |
parents | 4e03f3976d4b |
children | e836b2bd683e |
files | flys-backend/src/main/java/de/intevation/flys/model/HWSLine.java |
diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/model/HWSLine.java Mon Feb 25 12:11:50 2013 +0100 +++ b/flys-backend/src/main/java/de/intevation/flys/model/HWSLine.java Mon Feb 25 12:13:22 2013 +0100 @@ -307,4 +307,15 @@ public void setRiver(River river) { this.river = river; } + + public static List<HWSLine> getLines(int riverId, String name) { + Session session = SessionHolder.HOLDER.get(); + + Query query = session.createQuery( + "from HWSLine where river.id =:river_id and name=:name"); + query.setParameter("river_id", riverId); + query.setParameter("name", name); + + return query.list(); + } }