comparison flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityMeasurementValue.java @ 4462:ab7cf7789daf

FlowVelocityMeasurementValue: Added 'fast' (db-unmapped) class to access values later.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 09 Nov 2012 10:24:48 +0100
parents 32a4ed054fc7
children
comparison
equal deleted inserted replaced
4461:32a4ed054fc7 4462:ab7cf7789daf
15 import javax.persistence.OneToOne; 15 import javax.persistence.OneToOne;
16 16
17 import org.apache.log4j.Logger; 17 import org.apache.log4j.Logger;
18 18
19 19
20 /** Measured Flow Velocities. */
20 @Entity 21 @Entity
21 @Table(name = "flow_velocity_measure_values") 22 @Table(name = "flow_velocity_measure_values")
22 public class FlowVelocityMeasurementValue 23 public class FlowVelocityMeasurementValue
23 implements Serializable 24 implements Serializable
24 { 25 {
35 private BigDecimal v; 36 private BigDecimal v;
36 37
37 private Date datetime; 38 private Date datetime;
38 39
39 private String description; 40 private String description;
41
42 /** Non-mapped class holding same values. */
43 public static class FastFlowVelocityMeasurementValue {
44 protected double station;
45 protected double w;
46 protected double q;
47 protected double v;
48 protected Date datetime;
49 protected String description;
50
51 public FastFlowVelocityMeasurementValue(double station,
52 double w, double q, double v, Date datetime, String description) {
53 this.station = station;
54 this.w = w;
55 this.q = q;
56 this.v = v;
57 this.datetime = datetime;
58 this.description = description;
59 }
60
61 public double getStation() {
62 return station;
63 }
64
65 public double getW() {
66 return w;
67 }
68
69 public double getQ() {
70 return q;
71 }
72
73 public double getV() {
74 return v;
75 }
76
77 public Date getDatetime() {
78 return datetime;
79 }
80
81 public String getDescription() {
82 return description;
83 }
84 }
40 85
41 86
42 public FlowVelocityMeasurementValue() { 87 public FlowVelocityMeasurementValue() {
43 } 88 }
44 89
57 this.station = station; 102 this.station = station;
58 this.w = w; 103 this.w = w;
59 this.q = q; 104 this.q = q;
60 this.v = v; 105 this.v = v;
61 this.description = description; 106 this.description = description;
107 }
108
109 public static FastFlowVelocityMeasurementValue getUnmapped(
110 double station, double w, double q, double v, Date datetime, String description) {
111 return new FastFlowVelocityMeasurementValue(
112 station, w, q, v, datetime, description);
62 } 113 }
63 114
64 @Id 115 @Id
65 @SequenceGenerator( 116 @SequenceGenerator(
66 name = "SEQUENCE_FV_MEASURE_VALUES_ID_SEQ", 117 name = "SEQUENCE_FV_MEASURE_VALUES_ID_SEQ",

http://dive4elements.wald.intevation.org