Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/BedHeightValue.java @ 9444:ecadc9ed0ba0
Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
author | mschaefer |
---|---|
date | Tue, 21 Aug 2018 13:41:18 +0200 |
parents | 8aa7d9eaaa21 |
children |
comparison
equal
deleted
inserted
replaced
9443:515643b2c49a | 9444:ecadc9ed0ba0 |
---|---|
248 public void setHeight10(final Double height) { | 248 public void setHeight10(final Double height) { |
249 this.height10 = height; | 249 this.height10 = height; |
250 } | 250 } |
251 | 251 |
252 @Transient | 252 @Transient |
253 public Double getSectionHeight(final int index) { | |
254 switch (index) { | |
255 case 1: | |
256 return this.height01; | |
257 case 2: | |
258 return this.height02; | |
259 case 3: | |
260 return this.height03; | |
261 case 4: | |
262 return this.height04; | |
263 case 5: | |
264 return this.height05; | |
265 case 6: | |
266 return this.height06; | |
267 case 7: | |
268 return this.height07; | |
269 case 8: | |
270 return this.height08; | |
271 case 9: | |
272 return this.height09; | |
273 case 10: | |
274 return this.height10; | |
275 default: | |
276 throw new IllegalArgumentException(); | |
277 } | |
278 } | |
279 | |
280 @Transient | |
253 public void setSectionHeight(final int index, final Double value) { | 281 public void setSectionHeight(final int index, final Double value) { |
254 switch (index) { | 282 switch (index) { |
255 case 1: | 283 case 1: |
256 this.height01 = value; | 284 this.height01 = value; |
257 break; | 285 break; |
284 break; | 312 break; |
285 default: | 313 default: |
286 break; | 314 break; |
287 } | 315 } |
288 } | 316 } |
317 | |
289 public static List<BedHeightValue> getBedHeightValues(final BedHeight single) { | 318 public static List<BedHeightValue> getBedHeightValues(final BedHeight single) { |
290 final Session session = SessionHolder.HOLDER.get(); | 319 final Session session = SessionHolder.HOLDER.get(); |
291 final Query query = session.createQuery("FROM BedHeightValue WHERE bedHeight=:single"); | 320 final Query query = session.createQuery("FROM BedHeightValue WHERE bedHeight=:single"); |
292 query.setParameter("single", single); | 321 query.setParameter("single", single); |
293 return query.list(); | 322 return query.list(); |