annotate flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityModel.java @ 2862:998f1a7dcfde

New shape importers and schema modifications. flys-backend/trunk@4345 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 04 May 2012 06:58:00 +0000
parents a948366d8ac5
children 5a89c2b05e6d
rev   line source
2825
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.model;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import java.io.Serializable;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 import java.util.List;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 import javax.persistence.Entity;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import javax.persistence.Id;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import javax.persistence.Table;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 import javax.persistence.GeneratedValue;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 import javax.persistence.Column;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import javax.persistence.SequenceGenerator;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import javax.persistence.GenerationType;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import javax.persistence.JoinColumn;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import javax.persistence.OneToOne;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import org.apache.log4j.Logger;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 @Entity
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 @Table(name = "flow_velocity_model")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 public class FlowVelocityModel
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 implements Serializable
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 private static Logger logger = Logger.getLogger(FlowVelocityModel.class);
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 private Integer id;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 private River river;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 private DischargeZone dischargeZone;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 private List<FlowVelocityModelValue> values;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 private String description;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 public FlowVelocityModel() {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 public FlowVelocityModel(River river, DischargeZone dischargeZone) {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 this(river, dischargeZone, null);
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 public FlowVelocityModel(
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 River river,
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 DischargeZone dischargeZone,
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 String description
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 ) {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 this.river = river;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 this.dischargeZone = dischargeZone;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 this.description = description;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 @Id
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 @SequenceGenerator(
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 name = "SEQUENCE_FLOW_VELOCITY_MODEL_ID_SEQ",
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 sequenceName = "FLOW_VELOCITY_MODEL_ID_SEQ",
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 allocationSize = 1)
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 @GeneratedValue(
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 strategy = GenerationType.SEQUENCE,
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 generator = "SEQUENCE_FLOW_VELOCITY_MODEL_ID_SEQ")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 @Column(name = "id")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 public Integer getId() {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 return id;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 public void setId(Integer id) {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 this.id = id;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 @OneToOne
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 @JoinColumn(name = "river_id")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 public River getRiver() {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 return river;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 public void setRiver(River river) {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 this.river = river;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 @OneToOne
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 @JoinColumn(name = "discharge_zone_id")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 public DischargeZone getDischargeZone() {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87 return dischargeZone;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 public void setDischargeZone(DischargeZone dischargeZone) {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91 this.dischargeZone = dischargeZone;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94 @Column(name = "description")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 public String getDescription() {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96 return description;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99 public void setDescription(String description) {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
100 this.description = description;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
101 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
102 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
103 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org