Mercurial > dive4elements > river
diff 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 |
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/model/BedHeightValue.java Mon Aug 20 18:50:33 2018 +0200 +++ b/backend/src/main/java/org/dive4elements/river/model/BedHeightValue.java Tue Aug 21 13:41:18 2018 +0200 @@ -250,6 +250,34 @@ } @Transient + public Double getSectionHeight(final int index) { + switch (index) { + case 1: + return this.height01; + case 2: + return this.height02; + case 3: + return this.height03; + case 4: + return this.height04; + case 5: + return this.height05; + case 6: + return this.height06; + case 7: + return this.height07; + case 8: + return this.height08; + case 9: + return this.height09; + case 10: + return this.height10; + default: + throw new IllegalArgumentException(); + } + } + + @Transient public void setSectionHeight(final int index, final Double value) { switch (index) { case 1: @@ -286,6 +314,7 @@ break; } } + public static List<BedHeightValue> getBedHeightValues(final BedHeight single) { final Session session = SessionHolder.HOLDER.get(); final Query query = session.createQuery("FROM BedHeightValue WHERE bedHeight=:single");