comparison flys-aft/src/main/java/de/intevation/aft/DischargeTable.java @ 4101:b6a18d706cbe

Added debugging for AFT time intervals. flys-aft/trunk@3630 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 09 Jan 2012 15:34:19 +0000
parents 006e99437fb9
children e8967ee1cb05
comparison
equal deleted inserted replaced
4100:981de0b77c6b 4101:b6a18d706cbe
8 import java.sql.ResultSet; 8 import java.sql.ResultSet;
9 9
10 import de.intevation.db.SymbolicStatement; 10 import de.intevation.db.SymbolicStatement;
11 import de.intevation.db.ConnectedStatements; 11 import de.intevation.db.ConnectedStatements;
12 12
13 import org.apache.log4j.Logger;
14
13 public class DischargeTable 15 public class DischargeTable
14 { 16 {
17 private static Logger log = Logger.getLogger(DischargeTable.class);
18
15 protected int id; 19 protected int id;
16 protected int gaugeId; 20 protected int gaugeId;
17 protected TimeInterval timeInterval; 21 protected TimeInterval timeInterval;
18 protected String description; 22 protected String description;
19 protected List<WQ> values; 23 protected List<WQ> values;
207 .clearParameters() 211 .clearParameters()
208 .setString("number", "%" + officialNumber) 212 .setString("number", "%" + officialNumber)
209 .executeQuery(); 213 .executeQuery();
210 214
211 while (rs.next()) { 215 while (rs.next()) {
212 int dtId = rs.getInt("ABFLUSSTAFEL_NR"); 216 int dtId = rs.getInt("ABFLUSSTAFEL_NR");
213 Date from = rs.getDate("GUELTIG_VON"); 217 Date from = rs.getDate("GUELTIG_VON");
214 Date to = rs.getDate("GUELTIG_BIS"); 218 Date to = rs.getDate("GUELTIG_BIS");
219
220 if (from != null && to != null && from.compareTo(to) > 0) {
221 log.warn("AFT: ABFLUSSTAFEL_NR = "
222 + dtId + ": " + from + " > " + to + ". -> swap");
223 Date temp = from;
224 from = to;
225 to = temp;
226 }
227
215 String description = rs.getString("ABFLUSSTAFEL_BEZ"); 228 String description = rs.getString("ABFLUSSTAFEL_BEZ");
216 if (description == null) { 229 if (description == null) {
217 description = String.valueOf(officialNumber); 230 description = String.valueOf(officialNumber);
218 } 231 }
219 232

http://dive4elements.wald.intevation.org