Mercurial > dive4elements > river
diff flys-backend/src/main/java/de/intevation/flys/model/HydrBoundaryPoly.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 | a2600507761e |
children |
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/model/HydrBoundaryPoly.java Thu Mar 28 15:56:24 2013 +0100 +++ b/flys-backend/src/main/java/de/intevation/flys/model/HydrBoundaryPoly.java Thu Mar 28 17:13:53 2013 +0100 @@ -104,6 +104,27 @@ return query.list(); } + public static List<HydrBoundaryPoly> getHydrBoundaries(int riverId, + int kind, int sectie, int sobek) { + Session session = SessionHolder.HOLDER.get(); + + String filter = " where river.id =:river_id"; + + if (kind != -1) { + filter += " and kind = " + kind; + } + if (sectie != -1) { + filter += " and sectie = " + sectie; + } + if (sobek != -1){ + filter += " and sobek = " + sobek; + } + + Query query = session.createQuery("from HydrBoundaryPoly" + filter); + query.setParameter("river_id", riverId); + return query.list(); + } + /** * Get sectie. *