[Dive4elements-commits] [PATCH 4 of 6] FlowVelocityMeasurementValue: Added 'fast' (db-unmapped) class to access values later

Wald Commits scm-commit at wald.intevation.org
Fri Nov 9 10:22:29 CET 2012


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1352453088 -3600
# Node ID ab7cf7789dafad23107ff8f6bb8b2095d8596051
# Parent  32a4ed054fc713cd9b7c15b1a5e029f32bf955d8
FlowVelocityMeasurementValue: Added 'fast' (db-unmapped) class to access values later.

diff -r 32a4ed054fc7 -r ab7cf7789daf flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityMeasurementValue.java
--- a/flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityMeasurementValue.java	Fri Nov 09 10:24:07 2012 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityMeasurementValue.java	Fri Nov 09 10:24:48 2012 +0100
@@ -17,6 +17,7 @@
 import org.apache.log4j.Logger;
 
 
+/** Measured Flow Velocities. */
 @Entity
 @Table(name = "flow_velocity_measure_values")
 public class FlowVelocityMeasurementValue
@@ -38,6 +39,50 @@
 
     private String description;
 
+    /** Non-mapped class holding same values. */
+    public static class FastFlowVelocityMeasurementValue {
+        protected double station;
+        protected double w;
+        protected double q;
+        protected double v;
+        protected Date   datetime;
+        protected String description;
+
+        public FastFlowVelocityMeasurementValue(double station,
+            double w, double q, double v, Date datetime, String description) {
+            this.station = station;
+            this.w       = w;
+            this.q       = q;
+            this.v       = v;
+            this.datetime = datetime;
+            this.description = description;
+        }
+
+        public double getStation() {
+            return station;
+        }
+
+        public double getW() {
+            return w;
+        }
+
+        public double getQ() {
+            return q;
+        }
+
+        public double getV() {
+            return v;
+        }
+
+        public Date getDatetime() {
+            return datetime;
+        }
+
+        public String getDescription() {
+            return description;
+        }
+    }
+
 
     public FlowVelocityMeasurementValue() {
     }
@@ -61,6 +106,12 @@
         this.description = description;
     }
 
+    public static FastFlowVelocityMeasurementValue getUnmapped(
+            double station, double w, double q, double v, Date datetime, String description) {
+         return new FastFlowVelocityMeasurementValue(
+             station, w, q, v, datetime, description);
+    }
+
     @Id
     @SequenceGenerator(
         name           = "SEQUENCE_FV_MEASURE_VALUES_ID_SEQ",


More information about the Dive4elements-commits mailing list