Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/CrossSection.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | 8abe94270f32 |
children | 8d6e56e57c4a 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8855:d7c005e12af0 | 8856:5e38e2924c07 |
---|---|
65 "WHERE cross_section_id IN " + | 65 "WHERE cross_section_id IN " + |
66 " (SELECT id FROM cross_sections WHERE river_id = :river_id) " + | 66 " (SELECT id FROM cross_sections WHERE river_id = :river_id) " + |
67 " GROUP BY cross_section_id" + | 67 " GROUP BY cross_section_id" + |
68 ") cs_ranges " + | 68 ") cs_ranges " + |
69 "JOIN cross_sections cs ON cs_ranges.cross_section_id = cs.id " + | 69 "JOIN cross_sections cs ON cs_ranges.cross_section_id = cs.id " + |
70 "LEFT OUTER JOIN time_intervals ON cs.time_interval_id = time_intervals.id " + | 70 "LEFT OUTER JOIN time_intervals " + |
71 " ON cs.time_interval_id = time_intervals.id " + | |
71 "WHERE :km BETWEEN minkm AND maxkm " + | 72 "WHERE :km BETWEEN minkm AND maxkm " + |
72 "ORDER BY stop_time desc, start_time desc, :km - minkm"; | 73 "ORDER BY stop_time desc, start_time desc, :km - minkm"; |
73 // Order by time interval missing. | 74 // Order by time interval missing. |
74 | 75 |
75 private Integer id; | 76 private Integer id; |
165 double startKm, | 166 double startKm, |
166 double endKm | 167 double endKm |
167 ) { | 168 ) { |
168 Session session = SessionHolder.HOLDER.get(); | 169 Session session = SessionHolder.HOLDER.get(); |
169 | 170 |
170 SQLQuery sqlQuery = session.createSQLQuery(SQL_FAST_CROSS_SECTION_LINES) | 171 SQLQuery sqlQuery = session.createSQLQuery( |
172 SQL_FAST_CROSS_SECTION_LINES) | |
171 .addScalar("km", StandardBasicTypes.DOUBLE) | 173 .addScalar("km", StandardBasicTypes.DOUBLE) |
172 .addScalar("x", StandardBasicTypes.DOUBLE) | 174 .addScalar("x", StandardBasicTypes.DOUBLE) |
173 .addScalar("y", StandardBasicTypes.DOUBLE) | 175 .addScalar("y", StandardBasicTypes.DOUBLE) |
174 .addScalar("csl_id", StandardBasicTypes.INTEGER); | 176 .addScalar("csl_id", StandardBasicTypes.INTEGER); |
175 | 177 |
218 | 220 |
219 return lines; | 221 return lines; |
220 } | 222 } |
221 | 223 |
222 /** | 224 /** |
223 * True if the given section is the "newest" for that river and has values at km. | 225 * True if the given section is the "newest" for that river |
226 * and has values at km. | |
224 * @param km Given station. | 227 * @param km Given station. |
225 * @return true if the section has the most advanced end of its validity interval | 228 * @return true if the section has the most advanced end of its validity |
226 * or the most advanced start of its validity interval. | 229 * interval or the most advanced start of its validity interval. |
227 */ | 230 */ |
228 public boolean shouldBeMaster(double km) { | 231 public boolean shouldBeMaster(double km) { |
229 Session session = SessionHolder.HOLDER.get(); | 232 Session session = SessionHolder.HOLDER.get(); |
230 | 233 |
231 SQLQuery sqlQuery = session.createSQLQuery(SQL_MIN_MAX) | 234 SQLQuery sqlQuery = session.createSQLQuery(SQL_MIN_MAX) |