diff 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
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/model/BedHeightValue.java	Fri Apr 27 17:41:59 2018 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/BedHeightValue.java	Mon Apr 30 10:13:15 2018 +0200
@@ -20,6 +20,7 @@
 import javax.persistence.OneToOne;
 import javax.persistence.SequenceGenerator;
 import javax.persistence.Table;
+import javax.persistence.Transient;
 
 import org.apache.log4j.Logger;
 import org.dive4elements.river.backend.SessionHolder;
@@ -46,6 +47,16 @@
     private Double soundingWidth;
     private Double minHeight;
     private Double maxHeight;
+    private Double height01;
+    private Double height02;
+    private Double height03;
+    private Double height04;
+    private Double height05;
+    private Double height06;
+    private Double height07;
+    private Double height08;
+    private Double height09;
+    private Double height10;
 
 
     public BedHeightValue() {
@@ -148,6 +159,133 @@
         this.maxHeight = maxHeight;
     }
 
+    @Column(name = "height01")
+    public Double getHeight01() {
+        return this.height01;
+    }
+
+    public void setHeight01(final Double height) {
+        this.height01 = height;
+    }
+
+    @Column(name = "height02")
+    public Double getHeight02() {
+        return this.height02;
+    }
+
+    public void setHeight02(final Double height) {
+        this.height02 = height;
+    }
+
+    @Column(name = "height03")
+    public Double getHeight03() {
+        return this.height03;
+    }
+
+    public void setHeight03(final Double height) {
+        this.height03 = height;
+    }
+
+    @Column(name = "height04")
+    public Double getHeight04() {
+        return this.height04;
+    }
+
+    public void setHeight04(final Double height) {
+        this.height04 = height;
+    }
+
+    @Column(name = "height05")
+    public Double getHeight05() {
+        return this.height05;
+    }
+
+    public void setHeight05(final Double height) {
+        this.height05 = height;
+    }
+
+    @Column(name = "height06")
+    public Double getHeight06() {
+        return this.height06;
+    }
+
+    public void setHeight06(final Double height) {
+        this.height06 = height;
+    }
+
+    @Column(name = "height07")
+    public Double getHeight07() {
+        return this.height07;
+    }
+
+    public void setHeight07(final Double height) {
+        this.height07 = height;
+    }
+
+    @Column(name = "height08")
+    public Double getHeight08() {
+        return this.height08;
+    }
+
+    public void setHeight08(final Double height) {
+        this.height08 = height;
+    }
+
+    @Column(name = "height09")
+    public Double getHeight09() {
+        return this.height09;
+    }
+
+    public void setHeight09(final Double height) {
+        this.height09 = height;
+    }
+
+    @Column(name = "height10")
+    public Double getHeight10() {
+        return this.height10;
+    }
+
+    public void setHeight10(final Double height) {
+        this.height10 = height;
+    }
+
+    @Transient
+    public void setSectionHeight(final int index, final Double value) {
+        switch (index) {
+        case 1:
+            this.height01 = value;
+            break;
+        case 2:
+            this.height02 = value;
+            break;
+        case 3:
+            this.height03 = value;
+            break;
+        case 4:
+            this.height04 = value;
+            break;
+        case 5:
+            this.height05 = value;
+            break;
+        case 6:
+            this.height06 = value;
+            break;
+        case 7:
+            this.height07 = value;
+            break;
+        case 8:
+            this.height08 = value;
+            break;
+        case 9:
+            this.height09 = value;
+            break;
+        case 10:
+            this.height10 = value;
+            break;
+        default:
+            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");

http://dive4elements.wald.intevation.org