annotate flys-backend/src/main/java/de/intevation/flys/model/FlowVelocityModelValue.java @ 4227:8138a90a674a

Be more tolerant with empty time intervals in discharge tables while comparing discharge tables.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 23 Oct 2012 15:46:31 +0200
parents 5a89c2b05e6d
children
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.math.BigDecimal;
2871
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
5 import java.util.List;
2825
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import javax.persistence.Entity;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import javax.persistence.Id;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 import javax.persistence.Table;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 import javax.persistence.GeneratedValue;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import javax.persistence.Column;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import javax.persistence.SequenceGenerator;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import javax.persistence.GenerationType;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import javax.persistence.JoinColumn;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 import javax.persistence.OneToOne;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
2871
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
17 import org.hibernate.Session;
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
18 import org.hibernate.Query;
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
19
2825
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 import org.apache.log4j.Logger;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
2871
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
22 import de.intevation.flys.backend.SessionHolder;
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
23
2825
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 @Entity
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 @Table(name = "flow_velocity_model_values")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 public class FlowVelocityModelValue
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 implements Serializable
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 private static Logger logger =
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 Logger.getLogger(FlowVelocityModelValue.class);
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
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 private Integer id;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36 private FlowVelocityModel flowVelocity;
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 private BigDecimal station;
2828
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2825
diff changeset
39 private BigDecimal q;
2825
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 private BigDecimal totalChannel;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 private BigDecimal mainChannel;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 private BigDecimal shearStress;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43
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 public FlowVelocityModelValue() {
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
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 public FlowVelocityModelValue(
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 FlowVelocityModel flowVelocity,
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 BigDecimal station,
2828
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2825
diff changeset
52 BigDecimal q,
2825
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 BigDecimal totalChannel,
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 BigDecimal mainChannel,
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 BigDecimal shearStress
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 this.flowVelocity = flowVelocity;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 this.station = station;
2828
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2825
diff changeset
59 this.q = q;
2825
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 this.totalChannel = totalChannel;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 this.mainChannel = mainChannel;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 this.shearStress = shearStress;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 @Id
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 @SequenceGenerator(
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 name = "SEQUENCE_FLOW_VELOCITY_M_VALUES_ID_SEQ",
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 sequenceName = "FLOW_VELOCITY_M_VALUES_ID_SEQ",
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 allocationSize = 1)
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 @GeneratedValue(
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 strategy = GenerationType.SEQUENCE,
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 generator = "SEQUENCE_FLOW_VELOCITY_M_VALUES_ID_SEQ")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 @Column(name = "id")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 public Integer getId() {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 return id;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 public void setId(Integer id) {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 this.id = id;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 @OneToOne
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 @JoinColumn(name = "flow_velocity_model_id")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 public FlowVelocityModel getFlowVelocity() {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 return flowVelocity;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 public void setFlowVelocity(FlowVelocityModel flowVelocity) {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 this.flowVelocity = flowVelocity;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 @Column(name = "station")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93 public BigDecimal getStation() {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94 return station;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 public void setStation(BigDecimal station) {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98 this.station = station;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
100
2828
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2825
diff changeset
101 @Column(name = "q")
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2825
diff changeset
102 public BigDecimal getQ() {
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2825
diff changeset
103 return q;
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2825
diff changeset
104 }
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2825
diff changeset
105
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2825
diff changeset
106 public void setQ(BigDecimal q) {
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2825
diff changeset
107 this.q = q;
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2825
diff changeset
108 }
ac13e466a55e Added a parser for flow velocity model data and adjusted the db relation schema (missing q column).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2825
diff changeset
109
2825
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110 @Column(name = "total_channel")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111 public BigDecimal getTotalChannel() {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112 return totalChannel;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115 public void setTotalChannel(BigDecimal totalChannel) {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 this.totalChannel = totalChannel;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
119 @Column(name = "main_channel")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120 public BigDecimal getMainChannel() {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121 return mainChannel;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
122 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124 public void setMainChannel(BigDecimal mainChannel) {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125 this.mainChannel = mainChannel;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
126 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128 @Column(name = "shear_stress")
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
129 public BigDecimal getShearStress() {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130 return shearStress;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
132
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
133 public void setShearStress(BigDecimal shearStress) {
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
134 this.shearStress = shearStress;
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
135 }
2871
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
136
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
137
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
138 public static List<FlowVelocityModelValue> getValues(
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
139 FlowVelocityModel model,
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
140 double kmLo,
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
141 double kmHi
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
142 ) {
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
143 Session session = SessionHolder.HOLDER.get();
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
144
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
145 Query query = session.createQuery(
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
146 "from FlowVelocityModelValue where " +
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
147 " flowVelocity=:model and" +
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
148 " station >= :kmLo and " +
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
149 " station <= :kmHi");
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
150
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
151 query.setParameter("model", model);
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
152 query.setParameter("kmLo", new BigDecimal(kmLo));
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
153 query.setParameter("kmHi", new BigDecimal(kmHi));
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
154
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
155 return query.list();
5a89c2b05e6d Added functions to retrieve data from database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2828
diff changeset
156 }
2825
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
157 }
a948366d8ac5 Added new model classes for MINFO specific flow velocity.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
158 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org