Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/BedHeightSingleValue.java @ 6200:53fca3392c9f
Schema change and Importer: use double to prevent rounding at import time
author | Tom Gottfried <tom.gottfried@intevation.de> |
---|---|
date | Fri, 24 May 2013 16:03:52 +0200 |
parents | 4c3ccf2b0304 |
children | dc166b225775 |
comparison
equal
deleted
inserted
replaced
6091:75a38bc6baf2 | 6200:53fca3392c9f |
---|---|
41 | 41 |
42 private Integer id; | 42 private Integer id; |
43 | 43 |
44 private BedHeightSingle bedHeight; | 44 private BedHeightSingle bedHeight; |
45 | 45 |
46 private BigDecimal station; | 46 private Double station; |
47 private BigDecimal height; | 47 private Double height; |
48 private BigDecimal uncertainty; | 48 private Double uncertainty; |
49 private BigDecimal dataGap; | 49 private Double dataGap; |
50 private BigDecimal soundingWidth; | 50 private BigDecimal soundingWidth; |
51 private BigDecimal width; | 51 private Double width; |
52 | 52 |
53 | 53 |
54 public BedHeightSingleValue() { | 54 public BedHeightSingleValue() { |
55 } | 55 } |
56 | 56 |
57 public BedHeightSingleValue( | 57 public BedHeightSingleValue( |
58 BedHeightSingle bedHeight, | 58 BedHeightSingle bedHeight, |
59 BigDecimal station, | 59 Double station, |
60 BigDecimal height, | 60 Double height, |
61 BigDecimal uncertainty, | 61 Double uncertainty, |
62 BigDecimal dataGap, | 62 Double dataGap, |
63 BigDecimal soundingWidth, | 63 BigDecimal soundingWidth, |
64 BigDecimal width | 64 Double width |
65 ) { | 65 ) { |
66 this.bedHeight = bedHeight; | 66 this.bedHeight = bedHeight; |
67 this.station = station; | 67 this.station = station; |
68 this.height = height; | 68 this.height = height; |
69 this.uncertainty = uncertainty; | 69 this.uncertainty = uncertainty; |
98 public void setBedHeight(BedHeightSingle bedHeight) { | 98 public void setBedHeight(BedHeightSingle bedHeight) { |
99 this.bedHeight = bedHeight; | 99 this.bedHeight = bedHeight; |
100 } | 100 } |
101 | 101 |
102 @Column(name = "station") | 102 @Column(name = "station") |
103 public BigDecimal getStation() { | 103 public Double getStation() { |
104 return station; | 104 return station; |
105 } | 105 } |
106 | 106 |
107 public void setStation(BigDecimal station) { | 107 public void setStation(Double station) { |
108 this.station = station; | 108 this.station = station; |
109 } | 109 } |
110 | 110 |
111 @Column(name = "height") | 111 @Column(name = "height") |
112 public BigDecimal getHeight() { | 112 public Double getHeight() { |
113 return height; | 113 return height; |
114 } | 114 } |
115 | 115 |
116 public void setHeight(BigDecimal height) { | 116 public void setHeight(Double height) { |
117 this.height = height; | 117 this.height = height; |
118 } | 118 } |
119 | 119 |
120 @Column(name="uncertainty") | 120 @Column(name="uncertainty") |
121 public BigDecimal getUncertainty() { | 121 public Double getUncertainty() { |
122 return uncertainty; | 122 return uncertainty; |
123 } | 123 } |
124 | 124 |
125 public void setUncertainty(BigDecimal uncertainty) { | 125 public void setUncertainty(Double uncertainty) { |
126 this.uncertainty = uncertainty; | 126 this.uncertainty = uncertainty; |
127 } | 127 } |
128 | 128 |
129 @Column(name="data_gap") | 129 @Column(name="data_gap") |
130 public BigDecimal getDataGap() { | 130 public Double getDataGap() { |
131 return dataGap; | 131 return dataGap; |
132 } | 132 } |
133 | 133 |
134 public void setDataGap(BigDecimal dataGap) { | 134 public void setDataGap(Double dataGap) { |
135 this.dataGap = dataGap; | 135 this.dataGap = dataGap; |
136 } | 136 } |
137 | 137 |
138 @Column(name="sounding_width") | 138 @Column(name="sounding_width") |
139 public BigDecimal getSoundingWidth() { | 139 public BigDecimal getSoundingWidth() { |
143 public void setSoundingWidth(BigDecimal soundingWidth) { | 143 public void setSoundingWidth(BigDecimal soundingWidth) { |
144 this.soundingWidth = soundingWidth; | 144 this.soundingWidth = soundingWidth; |
145 } | 145 } |
146 | 146 |
147 @Column(name="width") | 147 @Column(name="width") |
148 public BigDecimal getWidth() { | 148 public Double getWidth() { |
149 return width; | 149 return width; |
150 } | 150 } |
151 | 151 |
152 public void setWidth(BigDecimal width) { | 152 public void setWidth(Double width) { |
153 this.width = width; | 153 this.width = width; |
154 } | 154 } |
155 | 155 |
156 | 156 |
157 public static List<BedHeightSingleValue> getBedHeightSingleValues( | 157 public static List<BedHeightSingleValue> getBedHeightSingleValues( |
164 Query query = session.createQuery( | 164 Query query = session.createQuery( |
165 "from BedHeightSingleValue where bedHeight=:single " + | 165 "from BedHeightSingleValue where bedHeight=:single " + |
166 " and station >= :kmLo and station <= :kmHi"); | 166 " and station >= :kmLo and station <= :kmHi"); |
167 | 167 |
168 query.setParameter("single", single); | 168 query.setParameter("single", single); |
169 query.setParameter("kmLo", new BigDecimal(kmLo)); | 169 query.setParameter("kmLo", new Double(kmLo)); |
170 query.setParameter("kmHi", new BigDecimal(kmHi)); | 170 query.setParameter("kmHi", new Double(kmHi)); |
171 | 171 |
172 return query.list(); | 172 return query.list(); |
173 } | 173 } |
174 } | 174 } |
175 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 175 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |