diff flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java @ 2375:61cb16549eb1

Modified the signature of RiverAxis.getRiverAxis() which now returns a list of RiverAxis objects instead of a single instance. flys-backend/trunk@3592 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 05 Jan 2012 10:42:20 +0000
parents 22eea1c9e907
children 6b1ca6ec4e3c
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java	Tue Jan 03 10:10:56 2012 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java	Thu Jan 05 10:42:20 2012 +0000
@@ -19,6 +19,13 @@
 import de.intevation.flys.backend.SessionHolder;
 
 
+/**
+ * There is a modeling problem with the RiverAxis. The initial idea was, that a
+ * river can have a riveraxis that consist of exact one geometry. Now, it has
+ * turned out, that a single geometry is not enough for a riveraxis (arm of a
+ * river, inflows, ...). As workaround, we now expect, that a river can just
+ * have a single riveraxis.
+ */
 @Entity
 @Table(name = "river_axes")
 public class RiverAxis
@@ -80,7 +87,7 @@
     }
 
 
-    public static RiverAxis getRiverAxis(String river) {
+    public static List<RiverAxis> getRiverAxis(String river) {
         Session session = SessionHolder.HOLDER.get();
 
         Query query = session.createQuery(
@@ -89,7 +96,7 @@
 
         List<RiverAxis> list = query.list();
 
-        return list.isEmpty() ? null : list.get(0);
+        return list.isEmpty() ? null : list;
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org