comparison flys-backend/src/main/java/de/intevation/flys/backend/SpatialInfo.java @ 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 fb4d87274f28
children c1b60f8c3390
comparison
equal deleted inserted replaced
5091:e836b2bd683e 5092:ed237d6e8e27
10 import de.intevation.flys.model.Building; 10 import de.intevation.flys.model.Building;
11 import de.intevation.flys.model.CrossSectionTrack; 11 import de.intevation.flys.model.CrossSectionTrack;
12 import de.intevation.flys.model.Fixpoint; 12 import de.intevation.flys.model.Fixpoint;
13 import de.intevation.flys.model.River; 13 import de.intevation.flys.model.River;
14 import de.intevation.flys.model.RiverAxis; 14 import de.intevation.flys.model.RiverAxis;
15 import de.intevation.flys.model.HWSLine;
15 16
16 17
17 public class SpatialInfo { 18 public class SpatialInfo {
18 19
19 private static Logger logger = Logger.getLogger(SpatialInfo.class); 20 private static Logger logger = Logger.getLogger(SpatialInfo.class);
140 } 141 }
141 else { 142 else {
142 logger.info("River contains " + list.size() + " Fixpoints."); 143 logger.info("River contains " + list.size() + " Fixpoints.");
143 } 144 }
144 } 145 }
146
147 @Deprecated
148 protected void doLinesInfo(River river) {
149 doHWSLinesInfo(river);
150 }
151
152 protected void doHWSLinesInfo(River river) {
153 Query query = session.createQuery(
154 "from hws_lines where river =:river");
155 query.setParameter("river", river);
156
157 List<HWSLine> list = query.list();
158
159 if (list == null || list.size() == 0) {
160 logger.warn("No Lines for '" + river.getName() + "' found!");
161 return;
162 }
163 else {
164 logger.info("River contains " + list.size() + " Lines.");
165 }
166 }
145 } 167 }
146 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : 168 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org