Mercurial > dive4elements > river
comparison flys-aft/src/main/java/de/intevation/aft/DischargeTable.java @ 4134:9c78264109ad
AFT: Ignored tables with unset GUELTIG_VON or GUELTIG_BIS values.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Mon, 15 Oct 2012 12:00:28 +0200 |
parents | 06891562e633 |
children | 79bb64f66c74 |
comparison
equal
deleted
inserted
replaced
4133:c722c08cf502 | 4134:9c78264109ad |
---|---|
226 OUTER: while (rs.next()) { | 226 OUTER: while (rs.next()) { |
227 int dtId = rs.getInt("ABFLUSSTAFEL_NR"); | 227 int dtId = rs.getInt("ABFLUSSTAFEL_NR"); |
228 Date from = rs.getDate("GUELTIG_VON"); | 228 Date from = rs.getDate("GUELTIG_VON"); |
229 Date to = rs.getDate("GUELTIG_BIS"); | 229 Date to = rs.getDate("GUELTIG_BIS"); |
230 | 230 |
231 if (from != null && to != null && from.compareTo(to) > 0) { | 231 if (from == null) { |
232 log.warn("AFT: ABFLUSSTAFEL_NR = " | |
233 + dtId + ": GUELTIG_VON = NULL -> ignored."); | |
234 } | |
235 | |
236 if (to == null) { | |
237 log.warn("AFT: ABFLUSSTAFEL_NR = " | |
238 + dtId + ": GUELTIG_BIS = NULL -> ignored."); | |
239 } | |
240 | |
241 if (from == null || to == null) { | |
242 continue; | |
243 } | |
244 | |
245 if (from.compareTo(to) > 0) { | |
232 log.warn("AFT: ABFLUSSTAFEL_NR = " | 246 log.warn("AFT: ABFLUSSTAFEL_NR = " |
233 + dtId + ": " + from + " > " + to + ". -> swap"); | 247 + dtId + ": " + from + " > " + to + ". -> swap"); |
234 Date temp = from; | 248 Date temp = from; |
235 from = to; | 249 from = to; |
236 to = temp; | 250 to = temp; |
250 } | 264 } |
251 | 265 |
252 double datumValue = rs.getDouble("PEGELNULLPUNKT"); | 266 double datumValue = rs.getDouble("PEGELNULLPUNKT"); |
253 Double datum = rs.wasNull() ? null : datumValue; | 267 Double datum = rs.wasNull() ? null : datumValue; |
254 | 268 |
255 TimeInterval timeInterval = from == null | 269 TimeInterval timeInterval = new TimeInterval(from, to); |
256 ? null | |
257 : new TimeInterval(from, to); | |
258 | 270 |
259 DischargeTable dt = new DischargeTable( | 271 DischargeTable dt = new DischargeTable( |
260 dtId, | 272 dtId, |
261 flysGaugeId, | 273 flysGaugeId, |
262 timeInterval, | 274 timeInterval, |