Mercurial > dive4elements > river
annotate flys-backend/src/main/java/de/intevation/flys/model/Gauge.java @ 2385:83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
flys-backend/trunk@3994 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 09 Feb 2012 11:30:26 +0000 |
parents | aa777d1aba38 |
children | 8df746f374cc |
rev | line source |
---|---|
167
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.model; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import java.math.BigDecimal; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 import java.io.Serializable; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 |
203
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
7 import java.util.List; |
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
8 |
171
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
9 import javax.persistence.Entity; |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
10 import javax.persistence.Id; |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
11 import javax.persistence.Table; |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
12 import javax.persistence.GeneratedValue; |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
13 import javax.persistence.Column; |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
14 import javax.persistence.SequenceGenerator; |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
15 import javax.persistence.GenerationType; |
174
249390dd24e7
Added foreign key constraint annotations to model classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
172
diff
changeset
|
16 import javax.persistence.JoinColumn; |
249390dd24e7
Added foreign key constraint annotations to model classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
172
diff
changeset
|
17 import javax.persistence.OneToOne; |
203
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
18 import javax.persistence.OneToMany; |
171
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
19 |
468
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
20 import org.hibernate.Session; |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
21 import org.hibernate.Query; |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
22 |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
23 import de.intevation.flys.backend.SessionHolder; |
1233
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
24 import de.intevation.flys.model.MainValue; |
468
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
25 |
171
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
26 @Entity |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
27 @Table(name = "gauges") |
167
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 public class Gauge |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 implements Serializable |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 { |
480
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
31 public static final int DEFAULT_SCALE = 100; |
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
32 |
2385
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
33 public static final int MASTER_DISCHARGE_TABLE = 0; |
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
34 |
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
35 |
171
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
36 private Integer id; |
167
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 private String name; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 private River river; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 private BigDecimal station; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 private BigDecimal aeo; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 private BigDecimal datum; |
2371
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
42 private Long officialNumber; |
167
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 private Range range; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 |
203
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
45 private List<DischargeTable> dischargeTables; |
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
46 |
1233
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
47 /** MainValues at this Gauge. */ |
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
48 protected List<MainValue> mainValues; |
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
49 |
167
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 public Gauge() { |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
51 } |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 |
192
f1fce41347ea
Added missing ImportGauge.getPeer() method
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
174
diff
changeset
|
53 public Gauge( |
f1fce41347ea
Added missing ImportGauge.getPeer() method
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
174
diff
changeset
|
54 String name, |
f1fce41347ea
Added missing ImportGauge.getPeer() method
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
174
diff
changeset
|
55 River river, |
f1fce41347ea
Added missing ImportGauge.getPeer() method
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
174
diff
changeset
|
56 BigDecimal station, |
f1fce41347ea
Added missing ImportGauge.getPeer() method
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
174
diff
changeset
|
57 BigDecimal aeo, |
f1fce41347ea
Added missing ImportGauge.getPeer() method
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
174
diff
changeset
|
58 BigDecimal datum, |
2371
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
59 Long officialNumber, |
192
f1fce41347ea
Added missing ImportGauge.getPeer() method
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
174
diff
changeset
|
60 Range range |
f1fce41347ea
Added missing ImportGauge.getPeer() method
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
174
diff
changeset
|
61 ) { |
2371
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
62 this.name = name; |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
63 this.river = river; |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
64 this.station = station; |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
65 this.aeo = aeo; |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
66 this.datum = datum; |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
67 this.officialNumber = officialNumber; |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
68 this.range = range; |
192
f1fce41347ea
Added missing ImportGauge.getPeer() method
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
174
diff
changeset
|
69 } |
f1fce41347ea
Added missing ImportGauge.getPeer() method
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
174
diff
changeset
|
70 |
171
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
71 @Id |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
72 @SequenceGenerator( |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
73 name = "SEQUENCE_GAUGES_ID_SEQ", |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
74 sequenceName = "GAUGES_ID_SEQ", |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
75 allocationSize = 1) |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
76 @GeneratedValue( |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
77 strategy = GenerationType.SEQUENCE, |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
78 generator = "SEQUENCE_GAUGES_ID_SEQ") |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
79 @Column(name = "id") |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
80 public Integer getId() { |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
81 return id; |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
82 } |
4a83e14f40f9
Added entity and id annotations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
168
diff
changeset
|
83 |
168
86a1bd9cc50e
More Hibernate/JPA stuff
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
167
diff
changeset
|
84 public void setId(Integer id) { |
167
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
85 this.id = id; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
86 } |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
87 |
193
31c48d54f09d
Add forgotten column river_id in Gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
192
diff
changeset
|
88 @OneToOne |
31c48d54f09d
Add forgotten column river_id in Gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
192
diff
changeset
|
89 @JoinColumn(name = "river_id" ) |
31c48d54f09d
Add forgotten column river_id in Gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
192
diff
changeset
|
90 public River getRiver() { |
31c48d54f09d
Add forgotten column river_id in Gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
192
diff
changeset
|
91 return river; |
31c48d54f09d
Add forgotten column river_id in Gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
192
diff
changeset
|
92 } |
31c48d54f09d
Add forgotten column river_id in Gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
192
diff
changeset
|
93 |
31c48d54f09d
Add forgotten column river_id in Gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
192
diff
changeset
|
94 public void setRiver(River river) { |
31c48d54f09d
Add forgotten column river_id in Gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
192
diff
changeset
|
95 this.river = river; |
31c48d54f09d
Add forgotten column river_id in Gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
192
diff
changeset
|
96 } |
31c48d54f09d
Add forgotten column river_id in Gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
192
diff
changeset
|
97 |
172
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
98 @Column(name = "name") |
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
99 public String getName() { |
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
100 return name; |
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
101 } |
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
102 |
167
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
103 public void setName(String name) { |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
104 this.name = name; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
105 } |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
106 |
172
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
107 @Column(name = "station") // FIXME: type mapping needed |
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
108 public BigDecimal getStation() { |
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
109 return station; |
167
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
110 } |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
111 |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
112 public void setStation(BigDecimal station) { |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
113 this.station = station; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
114 } |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
115 |
172
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
116 @Column(name = "aeo") // FIXME: type mapping needed |
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
117 public BigDecimal getAeo() { |
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
118 return aeo; |
167
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
119 } |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
120 |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
121 public void setAeo(BigDecimal aeo) { |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
122 this.aeo = aeo; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
123 } |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
124 |
172
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
125 @Column(name = "datum") // FIXME: type mapping needed |
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
126 public BigDecimal getDatum() { |
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
127 return datum; |
167
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
128 } |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
129 |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
130 public void setDatum(BigDecimal datum) { |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
131 this.datum = datum; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
132 } |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
133 |
2371
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
134 @Column(name = "official_number") |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
135 public Long getOfficialNumber() { |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
136 return officialNumber; |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
137 } |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
138 |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
139 public void setOfficialNumber(Long officialNumber) { |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
140 this.officialNumber = officialNumber; |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
141 } |
fe89d6cf55fb
Added support for official gauge numbers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1233
diff
changeset
|
142 |
174
249390dd24e7
Added foreign key constraint annotations to model classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
172
diff
changeset
|
143 @OneToOne |
249390dd24e7
Added foreign key constraint annotations to model classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
172
diff
changeset
|
144 @JoinColumn(name = "range_id" ) |
172
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
145 public Range getRange() { |
605320b7df94
Added column annotations for simple fields. TODO: foreign keys.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
171
diff
changeset
|
146 return range; |
167
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
147 } |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
148 |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
149 public void setRange(Range range) { |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
150 this.range = range; |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
151 } |
203
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
152 |
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
153 @OneToMany |
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
154 @JoinColumn(name = "gauge_id") |
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
155 public List<DischargeTable> getDischargeTables() { |
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
156 return dischargeTables; |
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
157 } |
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
158 |
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
159 public void setDischargeTables(List<DischargeTable> dischargeTables) { |
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
160 this.dischargeTables = dischargeTables; |
bfee0e05b4e7
Added an one to many relation to the discharge tables of a gauge.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
193
diff
changeset
|
161 } |
468
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
162 |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
163 |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
164 /** |
480
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
165 * Returns min and max W values of this gauge based with a DEFAULT_SCALE. |
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
166 * |
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
167 * @return min and max W value of this gauge [min,max]. |
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
168 */ |
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
169 public double[] determineMinMaxW() { |
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
170 return determineMinMaxW(DEFAULT_SCALE); |
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
171 } |
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
172 |
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
173 |
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
174 /** |
468
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
175 * Returns min and max W values of this gauge. |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
176 * |
1233
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
177 * @return the min and max W value of this gauge [min,max]. |
468
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
178 */ |
480
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
179 public double[] determineMinMaxW(int scale) { |
468
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
180 Session session = SessionHolder.HOLDER.get(); |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
181 |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
182 List<DischargeTable> tables = getDischargeTables(); |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
183 DischargeTable dischargeTable = null; |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
184 |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
185 for (DischargeTable tmp: tables) { |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
186 if (tmp.getKind() == 0) { |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
187 dischargeTable = tmp; |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
188 break; |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
189 } |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
190 } |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
191 |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
192 if (dischargeTable == null) { |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
193 return null; |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
194 } |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
195 |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
196 Query query = session.createQuery( |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
197 "select min(w) as min, max(w) as max from DischargeTableValue " + |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
198 "where table_id =:table"); |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
199 query.setParameter("table", dischargeTable.getId()); |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
200 |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
201 List results = query.list(); |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
202 Object[] result = (Object[]) results.get(0); |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
203 |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
204 return result != null |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
205 ? new double[] { |
480
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
206 ((BigDecimal) result[0]).doubleValue() * scale, |
46bb2b9e0bdc
Introduced a 'scale' parameter in Gauge.determineMinMaxW().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
468
diff
changeset
|
207 ((BigDecimal) result[1]).doubleValue() * scale} |
468
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
208 : null; |
8d76556c9616
Added methods to retrieve the min and max W and Q values of a Wst and Gauge.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
203
diff
changeset
|
209 } |
1233
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
210 |
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
211 @OneToMany |
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
212 @JoinColumn(name = "gauge_id") |
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
213 public List<MainValue> getMainValues() { |
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
214 return mainValues; |
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
215 } |
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
216 |
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
217 public void setMainValues(List<MainValue> mainValues) { |
5a3109b8475f
Mapping and Accessors for MainValues of Gauge, by Sascha L. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
480
diff
changeset
|
218 this.mainValues = mainValues; |
2381
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
219 } |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
220 |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
221 |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
222 public static Gauge getGaugeByOfficialNumber(long number) { |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
223 Session session = SessionHolder.HOLDER.get(); |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
224 |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
225 Query query = session.createQuery( |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
226 "from Gauge where officialNumber=:number"); |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
227 |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
228 query.setParameter("number", number); |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
229 |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
230 List<Gauge> results = query.list(); |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
231 |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
232 return results.isEmpty() ? null : results.get(0); |
aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2371
diff
changeset
|
233 } |
2385
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
234 |
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
235 |
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
236 public DischargeTable fetchMasterDischargeTable() { |
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
237 for (DischargeTable dt: dischargeTables) { |
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
238 if (dt.getKind() == MASTER_DISCHARGE_TABLE) { |
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
239 return dt; |
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
240 } |
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
241 } |
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
242 |
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
243 return null; |
83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2381
diff
changeset
|
244 } |
167
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
245 } |
15d515fe15f5
Added POJOs to be mapped to schema.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
246 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |