changeset 5092:ed237d6e8e27 dami

Add HWSLinesInfo and point the old doLinesInfo method on that. doLinesInfo can be removed once HWS usage is properly implemented
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 25 Feb 2013 12:33:58 +0100
parents e836b2bd683e
children 558807975769
files flys-backend/src/main/java/de/intevation/flys/backend/SpatialInfo.java
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/backend/SpatialInfo.java	Mon Feb 25 12:21:57 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/backend/SpatialInfo.java	Mon Feb 25 12:33:58 2013 +0100
@@ -12,6 +12,7 @@
 import de.intevation.flys.model.Fixpoint;
 import de.intevation.flys.model.River;
 import de.intevation.flys.model.RiverAxis;
+import de.intevation.flys.model.HWSLine;
 
 
 public class SpatialInfo {
@@ -142,5 +143,26 @@
             logger.info("River contains " + list.size() + " Fixpoints.");
         }
     }
+
+    @Deprecated
+    protected void doLinesInfo(River river) {
+        doHWSLinesInfo(river);
+    }
+
+    protected void doHWSLinesInfo(River river) {
+        Query query = session.createQuery(
+            "from hws_lines where river =:river");
+        query.setParameter("river", river);
+
+        List<HWSLine> list = query.list();
+
+        if (list == null || list.size() == 0) {
+            logger.warn("No Lines for '" + river.getName() + "' found!");
+            return;
+        }
+        else {
+            logger.info("River contains " + list.size() + " Lines.");
+        }
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org