comparison backend/src/main/java/org/dive4elements/river/model/BedHeightValue.java @ 9034:8aa7d9eaaa21

Added bed_height_values section heights height01 to height10
author mschaefer
date Mon, 30 Apr 2018 10:13:15 +0200
parents a0a0a7f912ab
children ecadc9ed0ba0
comparison
equal deleted inserted replaced
9033:384eee4b4135 9034:8aa7d9eaaa21
18 import javax.persistence.Id; 18 import javax.persistence.Id;
19 import javax.persistence.JoinColumn; 19 import javax.persistence.JoinColumn;
20 import javax.persistence.OneToOne; 20 import javax.persistence.OneToOne;
21 import javax.persistence.SequenceGenerator; 21 import javax.persistence.SequenceGenerator;
22 import javax.persistence.Table; 22 import javax.persistence.Table;
23 import javax.persistence.Transient;
23 24
24 import org.apache.log4j.Logger; 25 import org.apache.log4j.Logger;
25 import org.dive4elements.river.backend.SessionHolder; 26 import org.dive4elements.river.backend.SessionHolder;
26 import org.hibernate.Query; 27 import org.hibernate.Query;
27 import org.hibernate.Session; 28 import org.hibernate.Session;
44 private Double uncertainty; 45 private Double uncertainty;
45 private Double dataGap; 46 private Double dataGap;
46 private Double soundingWidth; 47 private Double soundingWidth;
47 private Double minHeight; 48 private Double minHeight;
48 private Double maxHeight; 49 private Double maxHeight;
50 private Double height01;
51 private Double height02;
52 private Double height03;
53 private Double height04;
54 private Double height05;
55 private Double height06;
56 private Double height07;
57 private Double height08;
58 private Double height09;
59 private Double height10;
49 60
50 61
51 public BedHeightValue() { 62 public BedHeightValue() {
52 } 63 }
53 64
146 157
147 public void setMaxHeight(final Double maxHeight) { 158 public void setMaxHeight(final Double maxHeight) {
148 this.maxHeight = maxHeight; 159 this.maxHeight = maxHeight;
149 } 160 }
150 161
162 @Column(name = "height01")
163 public Double getHeight01() {
164 return this.height01;
165 }
166
167 public void setHeight01(final Double height) {
168 this.height01 = height;
169 }
170
171 @Column(name = "height02")
172 public Double getHeight02() {
173 return this.height02;
174 }
175
176 public void setHeight02(final Double height) {
177 this.height02 = height;
178 }
179
180 @Column(name = "height03")
181 public Double getHeight03() {
182 return this.height03;
183 }
184
185 public void setHeight03(final Double height) {
186 this.height03 = height;
187 }
188
189 @Column(name = "height04")
190 public Double getHeight04() {
191 return this.height04;
192 }
193
194 public void setHeight04(final Double height) {
195 this.height04 = height;
196 }
197
198 @Column(name = "height05")
199 public Double getHeight05() {
200 return this.height05;
201 }
202
203 public void setHeight05(final Double height) {
204 this.height05 = height;
205 }
206
207 @Column(name = "height06")
208 public Double getHeight06() {
209 return this.height06;
210 }
211
212 public void setHeight06(final Double height) {
213 this.height06 = height;
214 }
215
216 @Column(name = "height07")
217 public Double getHeight07() {
218 return this.height07;
219 }
220
221 public void setHeight07(final Double height) {
222 this.height07 = height;
223 }
224
225 @Column(name = "height08")
226 public Double getHeight08() {
227 return this.height08;
228 }
229
230 public void setHeight08(final Double height) {
231 this.height08 = height;
232 }
233
234 @Column(name = "height09")
235 public Double getHeight09() {
236 return this.height09;
237 }
238
239 public void setHeight09(final Double height) {
240 this.height09 = height;
241 }
242
243 @Column(name = "height10")
244 public Double getHeight10() {
245 return this.height10;
246 }
247
248 public void setHeight10(final Double height) {
249 this.height10 = height;
250 }
251
252 @Transient
253 public void setSectionHeight(final int index, final Double value) {
254 switch (index) {
255 case 1:
256 this.height01 = value;
257 break;
258 case 2:
259 this.height02 = value;
260 break;
261 case 3:
262 this.height03 = value;
263 break;
264 case 4:
265 this.height04 = value;
266 break;
267 case 5:
268 this.height05 = value;
269 break;
270 case 6:
271 this.height06 = value;
272 break;
273 case 7:
274 this.height07 = value;
275 break;
276 case 8:
277 this.height08 = value;
278 break;
279 case 9:
280 this.height09 = value;
281 break;
282 case 10:
283 this.height10 = value;
284 break;
285 default:
286 break;
287 }
288 }
151 public static List<BedHeightValue> getBedHeightValues(final BedHeight single) { 289 public static List<BedHeightValue> getBedHeightValues(final BedHeight single) {
152 final Session session = SessionHolder.HOLDER.get(); 290 final Session session = SessionHolder.HOLDER.get();
153 final Query query = session.createQuery("FROM BedHeightValue WHERE bedHeight=:single"); 291 final Query query = session.createQuery("FROM BedHeightValue WHERE bedHeight=:single");
154 query.setParameter("single", single); 292 query.setParameter("single", single);
155 return query.list(); 293 return query.list();

http://dive4elements.wald.intevation.org