Mercurial > dive4elements > river
annotate backend/src/main/java/org/dive4elements/river/model/BedHeight.java @ 9245:f5cff8708531
bedheight datasource for salix.historical
author | gernotbelger |
---|---|
date | Wed, 11 Jul 2018 14:45:01 +0200 |
parents | 8642a76f22be |
children | c08d5cfa4981 |
rev | line source |
---|---|
5844
4dd33b86dc61
Added header to river backend.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
4dd33b86dc61
Added header to river backend.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
4dd33b86dc61
Added header to river backend.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5992
4c3ccf2b0304
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5844
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5844
4dd33b86dc61
Added header to river backend.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5992
4c3ccf2b0304
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5844
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5844
4dd33b86dc61
Added header to river backend.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
4dd33b86dc61
Added header to river backend.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5829
18619c1e7c2a
Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5828
diff
changeset
|
9 package org.dive4elements.river.model; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import java.io.Serializable; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import java.util.List; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
14 import javax.persistence.Column; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import javax.persistence.Entity; |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
16 import javax.persistence.GeneratedValue; |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
17 import javax.persistence.GenerationType; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import javax.persistence.Id; |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
19 import javax.persistence.JoinColumn; |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
20 import javax.persistence.OneToMany; |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
21 import javax.persistence.OneToOne; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 import javax.persistence.SequenceGenerator; |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
23 import javax.persistence.Table; |
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
|
24 |
5829
18619c1e7c2a
Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5828
diff
changeset
|
25 import org.dive4elements.river.backend.SessionHolder; |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
26 import org.hibernate.Query; |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
27 import org.hibernate.Session; |
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
|
28 |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 @Entity |
8560
6fcf4717605f
Meta-data on sounding width associated to bed heights is redundant to real data associated to values.
"Tom Gottfried <tom@intevation.de>"
parents:
5992
diff
changeset
|
30 @Table(name = "bed_height") |
6fcf4717605f
Meta-data on sounding width associated to bed heights is redundant to real data associated to values.
"Tom Gottfried <tom@intevation.de>"
parents:
5992
diff
changeset
|
31 public class BedHeight implements Serializable { |
2809
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 Integer id; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 private Integer year; |
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 String evaluationBy; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 private String description; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 private River river; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 |
9074 | 41 private BedHeightType type; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 private LocationSystem locationSystem; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 private ElevationModel curElevationModel; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 private ElevationModel oldElevationModel; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 private Range range; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
51 private String sounding_width_info; |
9038
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
8975
diff
changeset
|
52 private String notes; |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
53 |
8560
6fcf4717605f
Meta-data on sounding width associated to bed heights is redundant to real data associated to values.
"Tom Gottfried <tom@intevation.de>"
parents:
5992
diff
changeset
|
54 private List<BedHeightValue> values; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
8560
6fcf4717605f
Meta-data on sounding width associated to bed heights is redundant to real data associated to values.
"Tom Gottfried <tom@intevation.de>"
parents:
5992
diff
changeset
|
56 public BedHeight() { |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
59 public BedHeight(final River river, final Integer year, final BedHeightType type, final LocationSystem locationSystem, |
9074 | 60 final ElevationModel curElevationModel, final Range range) { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
61 this(river, year, type, locationSystem, curElevationModel, null, range, null, null, null, null); |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
64 public BedHeight(final River river, final Integer year, final BedHeightType type, final LocationSystem locationSystem, |
9038
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
8975
diff
changeset
|
65 final ElevationModel curElevationModel, final ElevationModel oldElevationModel, final Range range, final String evaluationBy, |
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
8975
diff
changeset
|
66 final String description, final String sounding_width_info, final String notes) { |
9074 | 67 this.river = river; |
68 this.year = year; | |
69 this.type = type; | |
70 this.locationSystem = locationSystem; | |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 this.curElevationModel = curElevationModel; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 this.oldElevationModel = oldElevationModel; |
9074 | 73 this.range = range; |
74 this.evaluationBy = evaluationBy; | |
75 this.description = description; | |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
76 this.sounding_width_info = sounding_width_info; |
9038
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
8975
diff
changeset
|
77 this.notes = notes; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 @Id |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
81 @SequenceGenerator(name = "SEQUENCE_BED_HEIGHT_ID_SEQ", sequenceName = "BED_HEIGHT_ID_SEQ", allocationSize = 1) |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
82 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_BED_HEIGHT_ID_SEQ") |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 @Column(name = "id") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 public Integer getId() { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
85 return this.id; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
88 public void setId(final Integer id) { |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 this.id = id; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 @OneToOne |
8842 | 93 @JoinColumn(name = "river_id") |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 public River getRiver() { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
95 return this.river; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
98 public void setRiver(final River river) { |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 this.river = river; |
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 @Column(name = "year") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 public Integer getYear() { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
104 return this.year; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
107 public void setYear(final Integer year) { |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 this.year = year; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 @OneToOne |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 @JoinColumn(name = "type_id") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 public BedHeightType getType() { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
114 return this.type; |
2809
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 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
117 public void setType(final BedHeightType type) { |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 this.type = type; |
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 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 @OneToOne |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 @JoinColumn(name = "location_system_id") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 public LocationSystem getLocationSystem() { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
124 return this.locationSystem; |
2809
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 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
127 public void setLocationSystem(final LocationSystem locationSystem) { |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 this.locationSystem = locationSystem; |
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 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 @OneToOne |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 @JoinColumn(name = "cur_elevation_model_id") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 public ElevationModel getCurElevationModel() { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
134 return this.curElevationModel; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
137 public void setCurElevationModel(final ElevationModel curElevationModel) { |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 this.curElevationModel = curElevationModel; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 @OneToOne |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 @JoinColumn(name = "old_elevation_model_id") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 public ElevationModel getOldElevationModel() { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
144 return this.oldElevationModel; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
147 public void setOldElevationModel(final ElevationModel oldElevationModel) { |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 this.oldElevationModel = oldElevationModel; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 @OneToOne |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 @JoinColumn(name = "range_id") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
153 public Range getRange() { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
154 return this.range; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
157 public void setRange(final Range range) { |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
158 this.range = range; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
159 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 @Column(name = "evaluation_by") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 public String getEvaluationBy() { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
163 return this.evaluationBy; |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
164 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
166 public void setEvaluationBy(final String evaluationBy) { |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
167 this.evaluationBy = evaluationBy; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 } |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 @Column(name = "description") |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 public String getDescription() { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
172 return this.description; |
2809
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 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
175 public void setDescription(final String description) { |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
176 this.description = description; |
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 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
179 @Column(name = "sounding_width_info") |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
180 public String getSoundingWidthInfo() { |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
181 return this.sounding_width_info; |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
182 } |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
183 |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
184 public void setSoundingWidthInfo(final String sounding_width_info) { |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
185 this.sounding_width_info = sounding_width_info; |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
186 } |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
187 |
9038
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
8975
diff
changeset
|
188 @Column(name = "notes") |
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
8975
diff
changeset
|
189 public String getNotes() { |
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
8975
diff
changeset
|
190 return this.notes; |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
191 } |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
192 |
9038
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
8975
diff
changeset
|
193 public void setNotes(final String notes) { |
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
8975
diff
changeset
|
194 this.notes = notes; |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
195 } |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
196 |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 @OneToMany |
8560
6fcf4717605f
Meta-data on sounding width associated to bed heights is redundant to real data associated to values.
"Tom Gottfried <tom@intevation.de>"
parents:
5992
diff
changeset
|
198 @JoinColumn(name = "bed_height_id") |
6fcf4717605f
Meta-data on sounding width associated to bed heights is redundant to real data associated to values.
"Tom Gottfried <tom@intevation.de>"
parents:
5992
diff
changeset
|
199 public List<BedHeightValue> getValues() { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
200 return this.values; |
2809
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 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
203 public void setValues(final List<BedHeightValue> values) { |
2809
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
204 this.values = values; |
f283212966e8
Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
205 } |
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
|
206 |
9074 | 207 public static List<BedHeight> getBedHeights(final River river, final double kmLo, final double kmHi) { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
208 final Session session = SessionHolder.HOLDER.get(); |
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
|
209 |
9245 | 210 final Query query = session.createQuery("from BedHeight" + " where river=:river" + " and id in (select bedHeight.id from BedHeightValue" |
211 + " where station between :kmfrom and :kmto" + " group by bedHeight.id)"); | |
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
|
212 |
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
|
213 query.setParameter("river", river); |
9218
13b764afb536
Bed height queries extended by km range condition
mschaefer
parents:
9211
diff
changeset
|
214 query.setParameter("kmfrom", kmLo); |
13b764afb536
Bed height queries extended by km range condition
mschaefer
parents:
9211
diff
changeset
|
215 query.setParameter("kmto", kmHi); |
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
|
216 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
217 final List<BedHeight> singles = query.list(); |
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
|
218 |
9219
8642a76f22be
Fixed getBedHeights (removed the obsolete km filtering loop)
mschaefer
parents:
9218
diff
changeset
|
219 return singles; |
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
|
220 } |
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
|
221 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
222 public static BedHeight getBedHeightById(final int id) { |
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
223 final Session session = SessionHolder.HOLDER.get(); |
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
|
224 |
9074 | 225 final Query query = session.createQuery("from BedHeight where id=:id"); |
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
|
226 |
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
|
227 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
|
228 |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
229 final List<BedHeight> singles = query.list(); |
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
|
230 |
9098
32dd7e761e4e
Fixed condition for Query.list result (checking isEmpty added)
mschaefer
parents:
9089
diff
changeset
|
231 return ((singles != null) && !singles.isEmpty()) ? singles.get(0) : null; |
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 } |
8942
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8842
diff
changeset
|
233 |
9211
aca5a7a57a3a
SINFO-TKH: definition der standard sohlhöhen jetzt mit Gültigkeitsstrecke. Definitionsdateien aufgeteilt in eine pro Gewässer.
gernotbelger
parents:
9098
diff
changeset
|
234 public static BedHeight getBedHeightByDescription(final River river, final String description, final double startKm, final double endKm) { |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
235 |
8942
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8842
diff
changeset
|
236 final Session session = SessionHolder.HOLDER.get(); |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
237 |
9245 | 238 final Query query = session.createQuery("FROM BedHeight" + " WHERE (TRIM(description)=:description) AND river=:river" |
239 + " AND id IN (SELECT bedHeight.id FROM BedHeightValue" + " WHERE station BETWEEN :kmfrom AND :kmto" + " GROUP BY bedHeight.id)"); | |
9089
02e4a0d983c0
Fixed :bed heights finder did not consider the river correctly
gernotbelger
parents:
9074
diff
changeset
|
240 query.setParameter("river", river); |
8942
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8842
diff
changeset
|
241 query.setParameter("description", description); |
9218
13b764afb536
Bed height queries extended by km range condition
mschaefer
parents:
9211
diff
changeset
|
242 query.setParameter("kmfrom", startKm); |
13b764afb536
Bed height queries extended by km range condition
mschaefer
parents:
9211
diff
changeset
|
243 query.setParameter("kmto", endKm); |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
244 |
8942
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8842
diff
changeset
|
245 final List<BedHeight> singles = query.list(); |
8975
a0a0a7f912ab
Added new columns bed_height.comment and sounding_width_info; extended the bed height parser for the new meta data and the min/max_height columns
mschaefer
parents:
8942
diff
changeset
|
246 |
9098
32dd7e761e4e
Fixed condition for Query.list result (checking isEmpty added)
mschaefer
parents:
9089
diff
changeset
|
247 return ((singles != null) && !singles.isEmpty()) ? singles.get(0) : null; |
8942
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8842
diff
changeset
|
248 } |
9245 | 249 |
250 public static List<BedHeight> getBedHeightEpochs(final River river, final double startKm, final double endKm) { | |
251 | |
252 final Session session = SessionHolder.HOLDER.get(); | |
253 final String description = "epoch"; | |
254 final Query query = session.createQuery("FROM BedHeight" + " WHERE lower(description) LIKE :description AND " + "river=:river" | |
255 + " AND id IN (SELECT bedHeight.id FROM BedHeightValue" + " WHERE station BETWEEN :kmfrom AND :kmto" + " GROUP BY bedHeight.id)"); | |
256 query.setParameter("river", river); | |
257 query.setParameter("description", "%" + description + "%"); | |
258 query.setParameter("kmfrom", startKm); | |
259 query.setParameter("kmto", endKm); | |
260 | |
261 final List<BedHeight> singles = query.list(); | |
262 | |
263 return ((singles != null) && !singles.isEmpty()) ? singles : null; | |
264 } | |
265 | |
266 public static List<BedHeight> getBedHeightYear(final River river, final double startKm, final double endKm) { | |
267 | |
268 final Session session = SessionHolder.HOLDER.get(); | |
269 final String description = "epoch"; | |
270 final Query query = session.createQuery("FROM BedHeight" + " WHERE lower(description) NOT LIKE :description AND " + "river=:river" | |
271 + " AND id IN (SELECT bedHeight.id FROM BedHeightValue" + " WHERE station BETWEEN :kmfrom AND :kmto" + " GROUP BY bedHeight.id)"); | |
272 query.setParameter("river", river); | |
273 query.setParameter("description", "%" + description + "%"); | |
274 query.setParameter("kmfrom", startKm); | |
275 query.setParameter("kmto", endKm); | |
276 | |
277 final List<BedHeight> singles = query.list(); | |
278 | |
279 return ((singles != null) && !singles.isEmpty()) ? singles : null; | |
280 } | |
9211
aca5a7a57a3a
SINFO-TKH: definition der standard sohlhöhen jetzt mit Gültigkeitsstrecke. Definitionsdateien aufgeteilt in eine pro Gewässer.
gernotbelger
parents:
9098
diff
changeset
|
281 } |