annotate flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityMeasurement.java @ 5590:b75005269a6c

Datacage: Fix potential connection leak to SedDB.
author Sascha L. Teichmann <teichmann@intevation.de>
date Mon, 08 Apr 2013 12:07:43 +0200
parents cc6323401643
children
rev   line source
2830
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.model;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import java.io.Serializable;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 import java.util.List;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 import javax.persistence.Entity;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import javax.persistence.Id;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import javax.persistence.Table;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 import javax.persistence.GeneratedValue;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 import javax.persistence.Column;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import javax.persistence.SequenceGenerator;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import javax.persistence.GenerationType;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import javax.persistence.JoinColumn;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import javax.persistence.OneToOne;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 import javax.persistence.OneToMany;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 import org.apache.log4j.Logger;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 @Entity
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 @Table(name = "flow_velocity_measurements")
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 public class FlowVelocityMeasurement
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 implements Serializable
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 private static Logger logger =
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 Logger.getLogger(FlowVelocityMeasurement.class);
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 private Integer id;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 private River river;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 private String description;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 private List<FlowVelocityMeasurementValue> values;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 public FlowVelocityMeasurement() {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 }
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 public FlowVelocityMeasurement(River river, String description) {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 this.river = river;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 this.description = description;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 }
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 @Id
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 @SequenceGenerator(
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 name = "SEQUENCE_FV_MEASURE_ID_SEQ",
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 sequenceName = "FV_MEASURE_ID_SEQ",
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 allocationSize = 1)
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 @GeneratedValue(
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 strategy = GenerationType.SEQUENCE,
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 generator = "SEQUENCE_FV_MEASURE_ID_SEQ")
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 @Column(name = "id")
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 public Integer getId() {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 return id;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 }
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 public void setId(Integer id) {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 this.id = id;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 }
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 @OneToOne
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 @JoinColumn(name = "river_id" )
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 public River getRiver() {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 return river;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 }
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 public void setRiver(River river) {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 this.river = river;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 }
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 @Column(name = "description")
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 public String getDescription() {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 return description;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 }
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 public void setDescription(String description) {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 this.description = description;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 }
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 @OneToMany
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 @JoinColumn(name = "measurements_id")
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 public List<FlowVelocityMeasurementValue> getValues() {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 return values;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 }
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 public void setValues(List<FlowVelocityMeasurementValue> values) {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 this.values = values;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 }
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 public void addValue(FlowVelocityMeasurementValue value) {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93 this.values.add(value);
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94 }
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 }
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org