comparison flys-backend/src/main/java/de/intevation/flys/importer/ImportFlowVelocityModel.java @ 2828:ac13e466a55e

Added a parser for flow velocity model data and adjusted the db relation schema (missing q column). flys-backend/trunk@4245 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 17 Apr 2012 09:37:52 +0000
parents 85b25e74594f
children ac5bd90697c1
comparison
equal deleted inserted replaced
2827:85b25e74594f 2828:ac13e466a55e
1 package de.intevation.flys.importer; 1 package de.intevation.flys.importer;
2 2
3 import java.sql.SQLException; 3 import java.sql.SQLException;
4 import java.util.ArrayList;
4 import java.util.List; 5 import java.util.List;
5 6
6 import org.apache.log4j.Logger; 7 import org.apache.log4j.Logger;
7 8
8 import org.hibernate.Session; 9 import org.hibernate.Session;
27 private List<ImportFlowVelocityModelValue> values; 28 private List<ImportFlowVelocityModelValue> values;
28 29
29 private FlowVelocityModel peer; 30 private FlowVelocityModel peer;
30 31
31 32
33 public ImportFlowVelocityModel() {
34 values = new ArrayList<ImportFlowVelocityModelValue>();
35 }
36
37
32 public ImportFlowVelocityModel( 38 public ImportFlowVelocityModel(
33 ImportDischargeZone dischargeZone, 39 ImportDischargeZone dischargeZone,
34 String description 40 String description
35 ) { 41 ) {
42 this();
43
36 this.dischargeZone = dischargeZone; 44 this.dischargeZone = dischargeZone;
37 this.description = description; 45 this.description = description;
46 }
47
48
49 public void setDischargeZone(ImportDischargeZone dischargeZone) {
50 this.dischargeZone = dischargeZone;
51 }
52
53
54 public void setDescription(String description) {
55 this.description = description;
56 }
57
58
59 public void addValue(ImportFlowVelocityModelValue value) {
60 this.values.add(value);
38 } 61 }
39 62
40 63
41 public void storeDependencies(River river) 64 public void storeDependencies(River river)
42 throws SQLException, ConstraintViolationException 65 throws SQLException, ConstraintViolationException
43 { 66 {
44 log.debug("store dependencies"); 67 log.debug("store dependencies");
68
69 if (dischargeZone == null) {
70 log.warn("skip flow velocity model: No discharge zone specified.");
71 return;
72 }
45 73
46 dischargeZone.storeDependencies(river); 74 dischargeZone.storeDependencies(river);
47 75
48 FlowVelocityModel peer = getPeer(river); 76 FlowVelocityModel peer = getPeer(river);
49 77

http://dive4elements.wald.intevation.org