# HG changeset patch # User Andre Heinecke # Date 1361790802 -3600 # Node ID 2878b816e94504db0c391ddc9608f45d35f1b75d # Parent 4e03f3976d4b94dc804aae1389250231dd688197 Add getLines method to get a list of HWSLine elements Patch provided by Raimund Renkert diff -r 4e03f3976d4b -r 2878b816e945 flys-backend/src/main/java/de/intevation/flys/model/HWSLine.java --- 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 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(); + } }