Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/importer/ImportBedHeightSingle.java @ 2811:8926571e47fb
Finished importing MINFO bed heights (single and epoch).
flys-backend/trunk@4225 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 13 Apr 2012 07:24:55 +0000 |
parents | f283212966e8 |
children | 0d27d02b1208 |
comparison
equal
deleted
inserted
replaced
2810:04eeb45df27b | 2811:8926571e47fb |
---|---|
16 import de.intevation.flys.model.ElevationModel; | 16 import de.intevation.flys.model.ElevationModel; |
17 import de.intevation.flys.model.Range; | 17 import de.intevation.flys.model.Range; |
18 import de.intevation.flys.model.River; | 18 import de.intevation.flys.model.River; |
19 | 19 |
20 | 20 |
21 public class ImportBedHeightSingle | 21 public class ImportBedHeightSingle implements ImportBedHeight |
22 { | 22 { |
23 private static Logger log = Logger.getLogger(ImportBedHeightSingle.class); | 23 private static Logger log = Logger.getLogger(ImportBedHeightSingle.class); |
24 | 24 |
25 protected int year; | 25 protected int year; |
26 protected int soundingWidth; | 26 protected int soundingWidth; |
47 | 47 |
48 public String getDescription() { | 48 public String getDescription() { |
49 return description; | 49 return description; |
50 } | 50 } |
51 | 51 |
52 public List<ImportBedHeightSingleValue> getValues() { | 52 public int getValueCount() { |
53 return values; | 53 return values.size(); |
54 } | 54 } |
55 | 55 |
56 | 56 |
57 public void setYear(int year) { | 57 public void setYear(int year) { |
58 this.year = year; | 58 this.year = year; |
59 } | |
60 | |
61 public void setTimeInterval(ImportTimeInterval timeInterval) { | |
62 // do nothing | |
59 } | 63 } |
60 | 64 |
61 public void setSoundingWidth(int soundingWidth) { | 65 public void setSoundingWidth(int soundingWidth) { |
62 this.soundingWidth = soundingWidth; | 66 this.soundingWidth = soundingWidth; |
63 } | 67 } |
88 | 92 |
89 public void setOldElevationModel(ImportElevationModel oldElevationModel) { | 93 public void setOldElevationModel(ImportElevationModel oldElevationModel) { |
90 this.oldElevationModel = oldElevationModel; | 94 this.oldElevationModel = oldElevationModel; |
91 } | 95 } |
92 | 96 |
93 public void addValue(ImportBedHeightSingleValue value) { | 97 @Override |
94 values.add(value); | 98 public void addValue(ImportBedHeightValue value) { |
99 values.add((ImportBedHeightSingleValue) value); | |
95 } | 100 } |
96 | 101 |
102 @Override | |
97 public void storeDependencies(River river) | 103 public void storeDependencies(River river) |
98 throws SQLException, ConstraintViolationException | 104 throws SQLException, ConstraintViolationException |
99 { | 105 { |
100 log.info("Store dependencies for single: '" + getDescription() + "'"); | 106 log.info("Store dependencies for single: '" + getDescription() + "'"); |
101 | 107 |
118 BedHeightSingle peer = getPeer(river); | 124 BedHeightSingle peer = getPeer(river); |
119 | 125 |
120 for (ImportBedHeightSingleValue value: values) { | 126 for (ImportBedHeightSingleValue value: values) { |
121 value.storeDependencies(peer); | 127 value.storeDependencies(peer); |
122 } | 128 } |
129 | |
130 Session session = ImporterSession.getInstance().getDatabaseSession(); | |
131 session.flush(); | |
123 } | 132 } |
124 | 133 |
134 @Override | |
125 public BedHeightSingle getPeer(River river) { | 135 public BedHeightSingle getPeer(River river) { |
126 if (peer == null) { | 136 if (peer == null) { |
127 BedHeightType theType = type != null ? type.getPeer() : null; | 137 BedHeightType theType = type != null ? type.getPeer() : null; |
128 ElevationModel theCurModel = curElevationModel.getPeer(); | 138 ElevationModel theCurModel = curElevationModel.getPeer(); |
129 Range theRange = range != null ? range.getPeer(river) : null; | 139 Range theRange = range != null ? range.getPeer(river) : null; |