diff flys-backend/src/main/java/de/intevation/flys/model/HydrBoundary.java @ 5515:87dab419b924

Properly handle hydr_boundaries and hydr_boundaries_poly in datacage This also fixes hydr_boundaries_poly which refered to the wrong table
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 28 Mar 2013 17:13:53 +0100
parents 8aac391871f9
children
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/model/HydrBoundary.java	Thu Mar 28 15:56:24 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/model/HydrBoundary.java	Thu Mar 28 17:13:53 2013 +0100
@@ -91,6 +91,18 @@
         this.geom = geom;
     }
 
+    public static List<HydrBoundary> getHydrBoundaries(int riverId, String name, int kindId) {
+        Session session = SessionHolder.HOLDER.get();
+
+        Query query = session.createQuery(
+            "from HydrBoundary where river.id =:river_id and name=:name" + 
+            " and kind.id=:kind_id");
+        query.setParameter("river_id", riverId);
+        query.setParameter("name", name);
+        query.setParameter("kind_id", kindId);
+
+        return query.list();
+    }
 
     public static List<HydrBoundary> getHydrBoundaries(int riverId, String name) {
         Session session = SessionHolder.HOLDER.get();

http://dive4elements.wald.intevation.org