[Dive4elements-commits] [PATCH 2 of 6] Add getLines method to get a list of HWSLine elements

Wald Commits scm-commit at wald.intevation.org
Mon Feb 25 12:46:34 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1361790802 -3600
# Branch dami
# Node ID 2878b816e94504db0c391ddc9608f45d35f1b75d
# Parent  4e03f3976d4b94dc804aae1389250231dd688197
Add getLines method to get a list of HWSLine elements

    Patch provided by Raimund Renkert <rrenkert at intevation.de>

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<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();
+    }
 }


More information about the Dive4elements-commits mailing list