annotate flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityMeasurement.java @ 4140:a9bafa5445f9

Change updateUserCollections visibility to public The method must be called by FLYS to update the project list if a new gauge discharge curve collection is created.
author Björn Ricks <bjoern.ricks@intevation.de>
date Mon, 15 Oct 2012 16:19:11 +0200
parents 6faa47ca1fee
children cc6323401643
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
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 private Integer id;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 private River river;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 private String description;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 private List<FlowVelocityMeasurementValue> values;
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
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 public FlowVelocityMeasurement() {
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
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 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
43 this.river = river;
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 this.description = description;
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
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 @Id
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 @SequenceGenerator(
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 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
50 sequenceName = "FV_MEASURE_ID_SEQ",
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 allocationSize = 1)
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 @GeneratedValue(
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 strategy = GenerationType.SEQUENCE,
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 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
55 @Column(name = "id")
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 public Integer getId() {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 return id;
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
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 public void setId(Integer id) {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 this.id = id;
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
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 @OneToOne
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 @JoinColumn(name = "river_id" )
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 public River getRiver() {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 return river;
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
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 public void setRiver(River river) {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 this.river = river;
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
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 @Column(name = "description")
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 public String getDescription() {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 return description;
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
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 public void setDescription(String description) {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 this.description = description;
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
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 @OneToMany
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 @JoinColumn(name = "measurements_id")
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 public List<FlowVelocityMeasurementValue> getValues() {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 return values;
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
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 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
90 this.values = values;
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
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93 public void addValue(FlowVelocityMeasurementValue value) {
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94 this.values.add(value);
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 }
6faa47ca1fee Added new model classes for storing flow velocity measurements.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org