Mercurial > dive4elements > river
annotate flys-backend/src/main/java/de/intevation/flys/model/BedHeightSingle.java @ 4989:f4d61ac84b76 dami
If we bother to check if the file is readable we might also
bother to check if it's a file at all.
Thanks to teichmann for noticing
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 14 Feb 2013 10:54:02 +0100 |
parents | 5d8db3349b77 |
children |
rev | line source |
---|---|
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.model; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
2875
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
5 import java.util.ArrayList; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import java.util.List; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import javax.persistence.Entity; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import javax.persistence.Id; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import javax.persistence.Table; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import javax.persistence.GeneratedValue; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import javax.persistence.Column; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import javax.persistence.SequenceGenerator; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import javax.persistence.GenerationType; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import javax.persistence.JoinColumn; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import javax.persistence.OneToOne; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 import javax.persistence.OneToMany; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 |
2872
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
19 import org.hibernate.Session; |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
20 import org.hibernate.Query; |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
21 |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
22 import de.intevation.flys.backend.SessionHolder; |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
23 |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 @Entity |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 @Table(name = "bed_height_single") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 public class BedHeightSingle implements Serializable { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 private Integer id; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 private Integer year; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 private Integer soundingWidth; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 private String evaluationBy; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 private String description; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 private River river; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 private BedHeightType type; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 private LocationSystem locationSystem; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 private ElevationModel curElevationModel; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 private ElevationModel oldElevationModel; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 private Range range; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 private List<BedHeightSingleValue> values; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 public BedHeightSingle() { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 public BedHeightSingle( |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 River river, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 Integer year, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 Integer soundingWidth, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 BedHeightType type, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 LocationSystem locationSystem, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 ElevationModel curElevationModel, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 Range range |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 ) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 this( |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 river, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 year, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 soundingWidth, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 type, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 locationSystem, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 curElevationModel, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 null, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 range, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 null, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 null); |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 public BedHeightSingle( |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 River river, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 Integer year, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 Integer soundingWidth, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 BedHeightType type, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 LocationSystem locationSystem, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 ElevationModel curElevationModel, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 ElevationModel oldElevationModel, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 Range range, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 String evaluationBy, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 String description |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 ) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 this.river = river; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 this.year = year; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 this.soundingWidth = soundingWidth; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 this.type = type; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 this.locationSystem = locationSystem; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 this.curElevationModel = curElevationModel; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 this.oldElevationModel = oldElevationModel; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 this.range = range; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 this.evaluationBy = evaluationBy; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 this.description = description; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 @Id |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 @SequenceGenerator( |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 name = "SEQUENCE_BED_HEIGHT_SINGLE_ID_SEQ", |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 sequenceName = "BED_HEIGHT_SINGLE_ID_SEQ", |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 allocationSize = 1) |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 @GeneratedValue( |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 strategy = GenerationType.SEQUENCE, |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 generator = "SEQUENCE_BED_HEIGHT_SINGLE_ID_SEQ") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 @Column(name = "id") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 public Integer getId() { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 return id; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 public void setId(Integer id) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 this.id = id; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 @OneToOne |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 @JoinColumn(name = "river_id" ) |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 public River getRiver() { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 return river; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 public void setRiver(River river) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 this.river = river; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 @Column(name = "year") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 public Integer getYear() { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 return year; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 public void setYear(Integer year) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 this.year = year; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 @Column(name = "sounding_width") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 public Integer getSoundingWidth() { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 return soundingWidth; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 public void setSoundingWidth(Integer soundingWidth) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 this.soundingWidth = soundingWidth; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 @OneToOne |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 @JoinColumn(name = "type_id") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 public BedHeightType getType() { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 return type; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
153 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 public void setType(BedHeightType type) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 this.type = type; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
158 @OneToOne |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
159 @JoinColumn(name = "location_system_id") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 public LocationSystem getLocationSystem() { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 return locationSystem; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
164 public void setLocationSystem(LocationSystem locationSystem) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 this.locationSystem = locationSystem; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
167 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 @OneToOne |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 @JoinColumn(name = "cur_elevation_model_id") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 public ElevationModel getCurElevationModel() { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 return curElevationModel; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
172 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
173 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
174 public void setCurElevationModel(ElevationModel curElevationModel) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
175 this.curElevationModel = curElevationModel; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
176 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
177 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
178 @OneToOne |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
179 @JoinColumn(name = "old_elevation_model_id") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
180 public ElevationModel getOldElevationModel() { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
181 return oldElevationModel; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
182 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
184 public void setOldElevationModel(ElevationModel oldElevationModel) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
185 this.oldElevationModel = oldElevationModel; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
186 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
187 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
188 @OneToOne |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
189 @JoinColumn(name = "range_id") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
190 public Range getRange() { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
191 return range; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
192 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
194 public void setRange(Range range) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
195 this.range = range; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
196 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 @Column(name = "evaluation_by") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 public String getEvaluationBy() { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
200 return evaluationBy; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
201 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
202 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
203 public void setEvaluationBy(String evaluationBy) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
204 this.evaluationBy = evaluationBy; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
205 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
207 @Column(name = "description") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 public String getDescription() { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
209 return description; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
210 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
211 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 public void setDescription(String description) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 this.description = description; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
214 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
215 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
216 @OneToMany |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
217 @JoinColumn(name = "bed_height_single_id") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
218 public List<BedHeightSingleValue> getValues() { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
219 return values; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
221 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
222 public void setValues(List<BedHeightSingleValue> values) { |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
223 this.values = values; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
224 } |
2872
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
225 |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
226 |
2875
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
227 public static List<BedHeightSingle> getBedHeightSingles( |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
228 River river, |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
229 double kmLo, |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
230 double kmHi |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
231 ) { |
2872
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
232 Session session = SessionHolder.HOLDER.get(); |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
233 |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
234 Query query = session.createQuery( |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
235 "from BedHeightSingle where river=:river"); |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
236 |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
237 query.setParameter("river", river); |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
238 |
2875
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
239 // TODO Do km range filtering in SQL statement |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
240 |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
241 List<BedHeightSingle> singles = query.list(); |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
242 List<BedHeightSingle> good = new ArrayList<BedHeightSingle>(); |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
243 |
3952
5d8db3349b77
Backend: Code simplification. Removed trailing whietspace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3799
diff
changeset
|
244 for (BedHeightSingle s: singles) { |
2875
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
245 for (BedHeightSingleValue value: s.getValues()) { |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
246 double station = value.getStation().doubleValue(); |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
247 |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
248 if (station >= kmLo && station <= kmHi) { |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
249 good.add(s); |
3952
5d8db3349b77
Backend: Code simplification. Removed trailing whietspace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3799
diff
changeset
|
250 break; |
2875
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
251 } |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
252 } |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
253 } |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
254 |
444e52222941
Added lower and upper km to functions that return bed height singles and epochs for a given river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2872
diff
changeset
|
255 return good; |
2872
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
256 } |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
257 |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
258 |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
259 public static BedHeightSingle getBedHeightSingleById(int id) { |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
260 Session session = SessionHolder.HOLDER.get(); |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
261 |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
262 Query query = session.createQuery( |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
263 "from BedHeightSingle where id=:id"); |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
264 |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
265 query.setParameter("id", id); |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
266 |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
267 List<BedHeightSingle> singles = query.list(); |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
268 |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
269 return singles != null ? singles.get(0) : null; |
bcfdaa3a5bfc
Added functions to BedHeightSingle and BedHeightEpoch to get instances from db by id or river.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2809
diff
changeset
|
270 } |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
271 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
272 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |