changeset 3959:6b1ca6ec4e3c

Added a new method to RiverAxis to query a special kind of river axes (default, official, outsourced). flys-backend/trunk@5620 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 27 Sep 2012 13:43:31 +0000
parents 64b73dc1571c
children 9e4468d50329
files flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java
diffstat 2 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Thu Sep 27 12:55:26 2012 +0000
+++ b/flys-backend/ChangeLog	Thu Sep 27 13:43:31 2012 +0000
@@ -1,3 +1,8 @@
+2012-09-27  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/model/RiverAxis.java:
+	  Added new method to query a special kind of river axes.
+
 2012-09-27  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	Backend-part for fix of issue863.
--- a/flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java	Thu Sep 27 12:55:26 2012 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java	Thu Sep 27 13:43:31 2012 +0000
@@ -35,6 +35,11 @@
     private Integer    kind;
     private River      river;
     private LineString geom;
+    
+    public static final int DEFAULT_KIND = 0;
+    
+    public static final int KIND_OFFICIAL = 1;
+    public static final int KIND_OUTSOURCED = 2;
 
     public RiverAxis() {
     }
@@ -88,11 +93,16 @@
 
 
     public static List<RiverAxis> getRiverAxis(String river) {
+        return getRiverAxis(river, DEFAULT_KIND);
+    }
+    
+    public static List<RiverAxis> getRiverAxis(String river, int kind) {
         Session session = SessionHolder.HOLDER.get();
 
         Query query = session.createQuery(
-            "from RiverAxis where river.name =:river");
+            "from RiverAxis where river.name =:river AND kind =:kind");
         query.setParameter("river", river);
+        query.setParameter("kind", kind);
 
         List<RiverAxis> list = query.list();
 

http://dive4elements.wald.intevation.org