Mercurial > dive4elements > river
comparison flys-backend/src/main/java/org/dive4elements/river/model/FlowVelocityMeasurementValue.java @ 5828:dfb26b03b179
Moved directories to org.dive4elements.river
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 11:53:11 +0200 |
parents | flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityMeasurementValue.java@ab7cf7789daf |
children | 18619c1e7c2a |
comparison
equal
deleted
inserted
replaced
5827:e308d4ecd35a | 5828:dfb26b03b179 |
---|---|
1 package de.intevation.flys.model; | |
2 | |
3 import java.io.Serializable; | |
4 import java.math.BigDecimal; | |
5 import java.util.Date; | |
6 | |
7 import javax.persistence.Entity; | |
8 import javax.persistence.Id; | |
9 import javax.persistence.Table; | |
10 import javax.persistence.GeneratedValue; | |
11 import javax.persistence.Column; | |
12 import javax.persistence.SequenceGenerator; | |
13 import javax.persistence.GenerationType; | |
14 import javax.persistence.JoinColumn; | |
15 import javax.persistence.OneToOne; | |
16 | |
17 import org.apache.log4j.Logger; | |
18 | |
19 | |
20 /** Measured Flow Velocities. */ | |
21 @Entity | |
22 @Table(name = "flow_velocity_measure_values") | |
23 public class FlowVelocityMeasurementValue | |
24 implements Serializable | |
25 { | |
26 private static Logger logger = | |
27 Logger.getLogger(FlowVelocityMeasurementValue.class); | |
28 | |
29 private Integer id; | |
30 | |
31 private FlowVelocityMeasurement measurement; | |
32 | |
33 private BigDecimal station; | |
34 private BigDecimal w; | |
35 private BigDecimal q; | |
36 private BigDecimal v; | |
37 | |
38 private Date datetime; | |
39 | |
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 } | |
85 | |
86 | |
87 public FlowVelocityMeasurementValue() { | |
88 } | |
89 | |
90 | |
91 public FlowVelocityMeasurementValue( | |
92 FlowVelocityMeasurement measurement, | |
93 Date datetime, | |
94 BigDecimal station, | |
95 BigDecimal w, | |
96 BigDecimal q, | |
97 BigDecimal v, | |
98 String description | |
99 ) { | |
100 this.measurement = measurement; | |
101 this.datetime = datetime; | |
102 this.station = station; | |
103 this.w = w; | |
104 this.q = q; | |
105 this.v = v; | |
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); | |
113 } | |
114 | |
115 @Id | |
116 @SequenceGenerator( | |
117 name = "SEQUENCE_FV_MEASURE_VALUES_ID_SEQ", | |
118 sequenceName = "FV_MEASURE_VALUES_ID_SEQ", | |
119 allocationSize = 1) | |
120 @GeneratedValue( | |
121 strategy = GenerationType.SEQUENCE, | |
122 generator = "SEQUENCE_FV_MEASURE_VALUES_ID_SEQ") | |
123 @Column(name = "id") | |
124 public Integer getId() { | |
125 return id; | |
126 } | |
127 | |
128 public void setId(Integer id) { | |
129 this.id = id; | |
130 } | |
131 | |
132 @OneToOne | |
133 @JoinColumn(name = "measurements_id") | |
134 public FlowVelocityMeasurement getMeasurement() { | |
135 return measurement; | |
136 } | |
137 | |
138 public void setMeasurement(FlowVelocityMeasurement measurement) { | |
139 this.measurement = measurement; | |
140 } | |
141 | |
142 @Column(name = "station") | |
143 public BigDecimal getStation() { | |
144 return station; | |
145 } | |
146 | |
147 public void setStation(BigDecimal station) { | |
148 this.station = station; | |
149 } | |
150 | |
151 @Column(name = "datetime") | |
152 public Date getDatetime() { | |
153 return datetime; | |
154 } | |
155 | |
156 public void setDatetime(Date datetime) { | |
157 this.datetime = datetime; | |
158 } | |
159 | |
160 @Column(name = "w") | |
161 public BigDecimal getW() { | |
162 return w; | |
163 } | |
164 | |
165 public void setW(BigDecimal w) { | |
166 this.w = w; | |
167 } | |
168 | |
169 @Column(name = "q") | |
170 public BigDecimal getQ() { | |
171 return q; | |
172 } | |
173 | |
174 public void setQ(BigDecimal q) { | |
175 this.q = q; | |
176 } | |
177 | |
178 @Column(name = "v") | |
179 public BigDecimal getV() { | |
180 return v; | |
181 } | |
182 | |
183 public void setV(BigDecimal v) { | |
184 this.v = v; | |
185 } | |
186 | |
187 @Column(name = "description") | |
188 public String getDescription() { | |
189 return description; | |
190 } | |
191 | |
192 public void setDescription(String description) { | |
193 this.description = description; | |
194 } | |
195 } | |
196 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |