# HG changeset patch # User Ingo Weinzierl # Date 1348753411 0 # Node ID 6b1ca6ec4e3cbf8cde9c583cf5163e7b946d99fb # Parent 64b73dc1571c21e6b5a0ebf0033acf7b4c9aa3a7 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 diff -r 64b73dc1571c -r 6b1ca6ec4e3c flys-backend/ChangeLog --- 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 + + * 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 Backend-part for fix of issue863. diff -r 64b73dc1571c -r 6b1ca6ec4e3c flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java --- 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 getRiverAxis(String river) { + return getRiverAxis(river, DEFAULT_KIND); + } + + public static List 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 list = query.list();