annotate backend/src/main/java/org/dive4elements/river/model/BedHeight.java @ 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
author mschaefer
date Tue, 03 Apr 2018 10:40:57 +0200
parents 11bf13cf0463
children 4c5eeaff554c
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;
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
12 import java.util.ArrayList;
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import java.util.List;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14
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
15 import javax.persistence.Column;
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 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
17 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
18 import javax.persistence.GenerationType;
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 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
20 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
21 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
22 import javax.persistence.OneToOne;
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 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
24 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
25
5829
18619c1e7c2a Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5828
diff changeset
26 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
27 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
28 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
29
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 @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
32 @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
33 public class BedHeight implements Serializable {
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 private Integer id;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36 private Integer year;
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 String evaluationBy;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 private String description;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 private River river;
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 BedHeightType type;
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 LocationSystem locationSystem;
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 curElevationModel;
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 ElevationModel oldElevationModel;
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 private Range range;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52
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 private 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
54 private String comment;
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
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 private List<BedHeightValue> values;
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
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
59 public BedHeight() {
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 }
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62
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
63 public BedHeight(final River river, final Integer year, final BedHeightType type, final LocationSystem locationSystem,
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 final ElevationModel curElevationModel,
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
65 final Range range) {
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
66 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
67 }
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69
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
70 public BedHeight(final River river, final Integer year, final BedHeightType type, final LocationSystem locationSystem,
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
71 final ElevationModel curElevationModel,
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
72 final ElevationModel oldElevationModel, final Range range, final String evaluationBy, final String description, 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
73 final String comment) {
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 this.river = river;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 this.year = year;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 this.type = type;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 this.locationSystem = locationSystem;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 this.curElevationModel = curElevationModel;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 this.oldElevationModel = oldElevationModel;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 this.range = range;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 this.evaluationBy = evaluationBy;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 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
83 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
84 this.comment = comment;
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 }
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
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 @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
89 @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
90 @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
91 @Column(name = "id")
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 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
93 return this.id;
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94 }
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95
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
96 public void setId(final Integer id) {
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 this.id = id;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98 }
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
100 @OneToOne
8842
ff27548d078c Whitespace cosmetics.
Tom Gottfried <tom@intevation.de>
parents: 8560
diff changeset
101 @JoinColumn(name = "river_id")
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
102 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
103 return this.river;
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
104 }
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105
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
106 public void setRiver(final River river) {
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107 this.river = river;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108 }
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 @Column(name = "year")
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111 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
112 return this.year;
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 }
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114
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
115 public void setYear(final Integer year) {
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 this.year = year;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117 }
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 @OneToOne
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120 @JoinColumn(name = "type_id")
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121 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
122 return this.type;
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123 }
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124
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
125 public void setType(final BedHeightType type) {
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
126 this.type = type;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127 }
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 @OneToOne
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130 @JoinColumn(name = "location_system_id")
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131 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
132 return this.locationSystem;
2809
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
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
135 public void setLocationSystem(final LocationSystem locationSystem) {
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
136 this.locationSystem = locationSystem;
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 @OneToOne
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
140 @JoinColumn(name = "cur_elevation_model_id")
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
141 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
142 return this.curElevationModel;
2809
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
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
145 public void setCurElevationModel(final ElevationModel curElevationModel) {
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
146 this.curElevationModel = curElevationModel;
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
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
149 @OneToOne
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
150 @JoinColumn(name = "old_elevation_model_id")
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
151 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
152 return this.oldElevationModel;
2809
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
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
155 public void setOldElevationModel(final ElevationModel oldElevationModel) {
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
156 this.oldElevationModel = oldElevationModel;
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
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
159 @OneToOne
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
160 @JoinColumn(name = "range_id")
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
161 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
162 return this.range;
2809
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
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
165 public void setRange(final Range range) {
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
166 this.range = range;
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
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
169 @Column(name = "evaluation_by")
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
170 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
171 return this.evaluationBy;
2809
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
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
174 public void setEvaluationBy(final String evaluationBy) {
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
175 this.evaluationBy = evaluationBy;
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 @Column(name = "description")
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
179 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
180 return this.description;
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
181 }
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
182
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
183 public void setDescription(final String description) {
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
184 this.description = description;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
185 }
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
186
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
187 @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
188 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
189 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
190 }
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 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
193 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
194 }
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 @Column(name = "comment")
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
197 public String getComment() {
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
198 return this.comment;
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
199 }
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
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
201 public void setComment(final String comment) {
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
202 this.comment = comment;
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 }
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
204
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
205 @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
206 @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
207 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
208 return this.values;
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
209 }
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
210
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
211 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
212 this.values = values;
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
213 }
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
214
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
215
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
216 public static List<BedHeight> getBedHeights(
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 River river,
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
218 final double kmLo,
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
219 final double kmHi
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
220 ) {
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
221 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
222
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
223 final Query query = session.createQuery(
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
224 "from BedHeight where river=:river");
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 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
227
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
228 // 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
229
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
230 final List<BedHeight> singles = query.list();
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
231 final List<BedHeight> good = new ArrayList<>();
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
232
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
233 for (final BedHeight s: singles) {
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
234 for (final BedHeightValue value: s.getValues()) {
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 final double station = value.getStation().doubleValue();
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
236
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
237 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
238 good.add(s);
3952
5d8db3349b77 Backend: Code simplification. Removed trailing whietspace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3799
diff changeset
239 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
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 }
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 }
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
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
244 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
245 }
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
246
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
247
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
248 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
249 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
250
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
251 final Query query = session.createQuery(
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
252 "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
253
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
254 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
255
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
256 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
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 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
259 }
8942
11bf13cf0463 Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents: 8842
diff changeset
260
11bf13cf0463 Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents: 8842
diff changeset
261 public static BedHeight getBedHeightByDescription(final String 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
262
8942
11bf13cf0463 Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents: 8842
diff changeset
263 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
264
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
265 final Query query = session.createQuery("FROM BedHeight WHERE (trim(description)=:description)");
8942
11bf13cf0463 Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents: 8842
diff changeset
266 query.setParameter("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
267
8942
11bf13cf0463 Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents: 8842
diff changeset
268 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
269
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
270 return singles != null ? singles.get(0) : null;
8942
11bf13cf0463 Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents: 8842
diff changeset
271 }
2809
f283212966e8 Finished work on MINFO bed heights (single).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
272 }
8942
11bf13cf0463 Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents: 8842
diff changeset
273 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org