changeset 1233:5a3109b8475f

Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann. flys-backend/trunk@2572 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 25 Aug 2011 10:19:21 +0000
parents 3383e042a655
children c5c48f52dc7b
files flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/model/Gauge.java
diffstat 2 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Mon Aug 22 09:31:59 2011 +0000
+++ b/flys-backend/ChangeLog	Thu Aug 25 10:19:21 2011 +0000
@@ -1,3 +1,10 @@
+2011-08-25  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/model/Gauge.java (getMainValues)
+	  (setMainValues):
+	  New method and mapping to get/set MainValues of a Gauge. Essentially
+	  developed by Sascha L. Teichmann.
+
 2011-08-22  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java:
--- a/flys-backend/src/main/java/de/intevation/flys/model/Gauge.java	Mon Aug 22 09:31:59 2011 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/model/Gauge.java	Thu Aug 25 10:19:21 2011 +0000
@@ -21,7 +21,7 @@
 import org.hibernate.Query;
 
 import de.intevation.flys.backend.SessionHolder;
-
+import de.intevation.flys.model.MainValue;
 
 @Entity
 @Table(name = "gauges")
@@ -40,6 +40,9 @@
 
     private List<DischargeTable> dischargeTables;
 
+    /** MainValues at this Gauge. */
+    protected List<MainValue> mainValues;
+
     public Gauge() {
     }
 
@@ -156,7 +159,7 @@
     /**
      * Returns min and max W values of this gauge.
      *
-     *  @return the min and max W value of this gauge [min,max].
+     * @return the min and max W value of this gauge [min,max].
      */
     public double[] determineMinMaxW(int scale) {
         Session session = SessionHolder.HOLDER.get();
@@ -189,5 +192,15 @@
                 ((BigDecimal) result[1]).doubleValue() * scale}
             : null;
     }
+
+    @OneToMany
+    @JoinColumn(name = "gauge_id")
+    public List<MainValue> getMainValues() {
+        return mainValues;
+    }
+
+    public void setMainValues(List<MainValue> mainValues) {
+        this.mainValues = mainValues;
+    } 
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org