Mercurial > dive4elements > river
annotate backend/src/main/java/org/dive4elements/river/model/CrossSection.java @ 9462:e28303971812
another log
author | gernotbelger |
---|---|
date | Wed, 29 Aug 2018 17:58:02 +0200 |
parents | 8d6e56e57c4a |
children | 80800fe126cd |
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; |
1194
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 import java.io.Serializable; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 import java.util.List; |
2380
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
14 import java.util.ArrayList; |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
15 |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
16 import java.awt.geom.Point2D; |
1194
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 import javax.persistence.Entity; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 import javax.persistence.Id; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 import javax.persistence.Table; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 import javax.persistence.GeneratedValue; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 import javax.persistence.Column; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 import javax.persistence.SequenceGenerator; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 import javax.persistence.GenerationType; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 import javax.persistence.OneToOne; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 import javax.persistence.OneToMany; |
1210
31d8638760b1
New. The hibernate models
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
27 import javax.persistence.OrderBy; |
1194
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 import javax.persistence.JoinColumn; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 |
2379
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
30 import java.math.MathContext; |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
31 import java.math.BigDecimal; |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
32 |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
33 import org.hibernate.Session; |
2380
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
34 import org.hibernate.SQLQuery; |
2379
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
35 import org.hibernate.Query; |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
36 |
2380
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
37 import org.hibernate.type.StandardBasicTypes; |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
38 |
5829
18619c1e7c2a
Repaired internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5828
diff
changeset
|
39 import org.dive4elements.river.backend.SessionHolder; |
2379
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
40 |
6538
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
41 import org.apache.log4j.Logger; |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
42 |
1194
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 @Entity |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 @Table(name = "cross_sections") |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 public class CrossSection |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 implements Serializable |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 { |
8200
9d2e69f971f5
sed -i src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7017
diff
changeset
|
48 private static Logger log = |
6538
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
49 Logger.getLogger(CrossSection.class); |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
50 |
9460 | 51 private static final MathContext PRECISION = new MathContext(6); |
2379
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
52 |
9460 | 53 private static final String SQL_FAST_CROSS_SECTION_LINES = |
2380
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
54 "SELECT km, x, y, csl.id AS csl_id " + |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
55 "FROM cross_section_lines csl JOIN cross_section_points csp " + |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
56 "ON csp.cross_section_line_id = csl.id " + |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
57 "WHERE csl.cross_section_id = :cs_id AND " + |
3334
2ae732e2c65c
FLYS backend: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2380
diff
changeset
|
58 "km between :from_km AND :to_km " + |
6270
44ee7d26eb18
issue1267: Polishing: Move the sorting into the db/sql-query.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6269
diff
changeset
|
59 "ORDER BY csl.km, csl.id, csp.col_pos"; |
2380
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
60 |
9460 | 61 private static final String SQL_MIN_MAX = |
6536
c155f8f57b7e
Initial improved query to find matching cross section.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6270
diff
changeset
|
62 "SELECT * FROM ( "+ |
c155f8f57b7e
Initial improved query to find matching cross section.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6270
diff
changeset
|
63 "SELECT cross_section_id, MIN(km) AS minkm, MAX(km) AS maxkm " + |
c155f8f57b7e
Initial improved query to find matching cross section.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6270
diff
changeset
|
64 "FROM cross_section_lines " + |
c155f8f57b7e
Initial improved query to find matching cross section.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6270
diff
changeset
|
65 "WHERE cross_section_id IN " + |
c155f8f57b7e
Initial improved query to find matching cross section.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6270
diff
changeset
|
66 " (SELECT id FROM cross_sections WHERE river_id = :river_id) " + |
c155f8f57b7e
Initial improved query to find matching cross section.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6270
diff
changeset
|
67 " GROUP BY cross_section_id" + |
6621
7e697c6eb379
CrossSection: Improve SQl compat of statement.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6538
diff
changeset
|
68 ") cs_ranges " + |
6622
718b0822374d
CrossSection: Uppercase sql keywords in query.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6621
diff
changeset
|
69 "JOIN cross_sections cs ON cs_ranges.cross_section_id = cs.id " + |
8856 | 70 "LEFT OUTER JOIN time_intervals " + |
71 " ON cs.time_interval_id = time_intervals.id " + | |
6538
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
72 "WHERE :km BETWEEN minkm AND maxkm " + |
7017
b9633d6ce57e
issue1157: Fix sorting by start time (descending) for cross-section selection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6852
diff
changeset
|
73 "ORDER BY stop_time desc, start_time desc, :km - minkm"; |
6536
c155f8f57b7e
Initial improved query to find matching cross section.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6270
diff
changeset
|
74 // Order by time interval missing. |
c155f8f57b7e
Initial improved query to find matching cross section.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6270
diff
changeset
|
75 |
1203
3c01bef43a98
Querprofile: Added a table to map the points to a given km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1202
diff
changeset
|
76 private Integer id; |
3c01bef43a98
Querprofile: Added a table to map the points to a given km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1202
diff
changeset
|
77 private River river; |
3c01bef43a98
Querprofile: Added a table to map the points to a given km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1202
diff
changeset
|
78 private TimeInterval timeInterval; |
3c01bef43a98
Querprofile: Added a table to map the points to a given km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1202
diff
changeset
|
79 private String description; |
3c01bef43a98
Querprofile: Added a table to map the points to a given km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1202
diff
changeset
|
80 private List<CrossSectionLine> lines; |
1194
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
81 |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
82 public CrossSection() { |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
83 } |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
84 |
1204
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1203
diff
changeset
|
85 public CrossSection( |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1203
diff
changeset
|
86 River river, |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1203
diff
changeset
|
87 TimeInterval timeInterval, |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1203
diff
changeset
|
88 String description |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1203
diff
changeset
|
89 ) { |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1203
diff
changeset
|
90 this.river = river; |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1203
diff
changeset
|
91 this.timeInterval = timeInterval; |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1203
diff
changeset
|
92 this.description = description; |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1203
diff
changeset
|
93 } |
22858e7cca79
Integrated PRF parsing into importer. Needs testing!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1203
diff
changeset
|
94 |
1194
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
95 @Id |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 @SequenceGenerator( |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
97 name = "SEQUENCE_CROSS_SECTIONS_ID_SEQ", |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 sequenceName = "CROSS_SECTIONS_ID_SEQ", |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 allocationSize = 1) |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 @GeneratedValue( |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 strategy = GenerationType.SEQUENCE, |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 generator = "SEQUENCE_CROSS_SECTIONS_ID_SEQ") |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
103 @Column(name = "id") |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
104 public Integer getId() { |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
105 return id; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
106 } |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
107 |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
108 public void setId(Integer id) { |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
109 this.id = id; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
110 } |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
111 |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
112 @OneToOne |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
113 @JoinColumn(name = "river_id") |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
114 public River getRiver() { |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
115 return river; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
116 } |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
117 |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
118 public void setRiver(River river) { |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
119 this.river = river; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
120 } |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
121 |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
122 @OneToOne |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
123 @JoinColumn(name = "time_interval_id") |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
124 public TimeInterval getTimeInterval() { |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
125 return timeInterval; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
126 } |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
127 |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
128 public void setTimeInterval(TimeInterval timeInterval) { |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
129 this.timeInterval = timeInterval; |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
130 } |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
131 |
1202
44581b40b968
Schema: Added description column to the cross section table
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1194
diff
changeset
|
132 @Column(name = "description") |
44581b40b968
Schema: Added description column to the cross section table
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1194
diff
changeset
|
133 public String getDescription() { |
44581b40b968
Schema: Added description column to the cross section table
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1194
diff
changeset
|
134 return description; |
44581b40b968
Schema: Added description column to the cross section table
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1194
diff
changeset
|
135 } |
44581b40b968
Schema: Added description column to the cross section table
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1194
diff
changeset
|
136 |
44581b40b968
Schema: Added description column to the cross section table
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1194
diff
changeset
|
137 public void setDescription(String description) { |
44581b40b968
Schema: Added description column to the cross section table
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1194
diff
changeset
|
138 this.description = description; |
44581b40b968
Schema: Added description column to the cross section table
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1194
diff
changeset
|
139 } |
44581b40b968
Schema: Added description column to the cross section table
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1194
diff
changeset
|
140 |
1194
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
141 @OneToMany |
1210
31d8638760b1
New. The hibernate models
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1204
diff
changeset
|
142 @OrderBy("km") |
1194
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
143 @JoinColumn(name="cross_section_id") |
1203
3c01bef43a98
Querprofile: Added a table to map the points to a given km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1202
diff
changeset
|
144 public List<CrossSectionLine> getLines() { |
3c01bef43a98
Querprofile: Added a table to map the points to a given km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1202
diff
changeset
|
145 return lines; |
1194
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
146 } |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
147 |
1203
3c01bef43a98
Querprofile: Added a table to map the points to a given km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1202
diff
changeset
|
148 public void setLines(List<CrossSectionLine> lines) { |
3c01bef43a98
Querprofile: Added a table to map the points to a given km.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1202
diff
changeset
|
149 this.lines = lines; |
1194
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
150 } |
2379
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
151 |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
152 public List<CrossSectionLine> getLines(double startKm, double endKm) { |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
153 Session session = SessionHolder.HOLDER.get(); |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
154 Query query = session.createQuery( |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
155 "from CrossSectionLine where crossSection=:crossSection " + |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
156 "and km between :startKm and :endKm order by km"); |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
157 query.setParameter("crossSection", this); |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
158 query.setParameter("startKm", new BigDecimal(startKm, PRECISION)); |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
159 query.setParameter("endKm", new BigDecimal(endKm, PRECISION)); |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
160 |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
161 return query.list(); |
8be27b950dbe
CrossSection: Added method to extract the lines of a given km range.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1210
diff
changeset
|
162 } |
2380
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
163 |
6269 | 164 /** Get Lines from startkm to endkm, fast because direct usage of sql. */ |
2380
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
165 public List<FastCrossSectionLine> getFastLines( |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
166 double startKm, |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
167 double endKm |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
168 ) { |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
169 Session session = SessionHolder.HOLDER.get(); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
170 |
8856 | 171 SQLQuery sqlQuery = session.createSQLQuery( |
172 SQL_FAST_CROSS_SECTION_LINES) | |
2380
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
173 .addScalar("km", StandardBasicTypes.DOUBLE) |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
174 .addScalar("x", StandardBasicTypes.DOUBLE) |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
175 .addScalar("y", StandardBasicTypes.DOUBLE) |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
176 .addScalar("csl_id", StandardBasicTypes.INTEGER); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
177 |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
178 sqlQuery |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
179 .setInteger("cs_id", getId()) |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
180 .setDouble("from_km", startKm) |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
181 .setDouble("to_km", endKm); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
182 |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
183 List<Object []> results = sqlQuery.list(); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
184 |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
185 ArrayList<Point2D> points = new ArrayList<Point2D>(500); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
186 ArrayList<FastCrossSectionLine> lines = |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
187 new ArrayList<FastCrossSectionLine>(); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
188 |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
189 Integer lastId = null; |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
190 Double lastKm = null; |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
191 |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
192 for (Object [] result: results) { |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
193 Double km = (Double)result[0]; |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
194 Double x = (Double)result[1]; |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
195 Double y = (Double)result[2]; |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
196 Integer id = (Integer)result[3]; |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
197 |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
198 if (lastId != null && !lastId.equals(id)) { |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
199 points.trimToSize(); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
200 FastCrossSectionLine line = |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
201 new FastCrossSectionLine(lastKm, points); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
202 lines.add(line); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
203 points = new ArrayList<Point2D>(500); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
204 } |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
205 |
8813
8abe94270f32
Do not filter cross section points for display.
Tom Gottfried <tom@intevation.de>
parents:
8200
diff
changeset
|
206 points.add(new Point2D.Double(x, y)); |
2380
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
207 |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
208 lastKm = km; |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
209 lastId = id; |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
210 } |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
211 |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
212 if (lastId != null) { |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
213 points.trimToSize(); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
214 FastCrossSectionLine line = |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
215 new FastCrossSectionLine(lastKm, points); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
216 lines.add(line); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
217 } |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
218 |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
219 lines.trimToSize(); |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
220 |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
221 return lines; |
e237a08acf6e
Create fast cross section lines in the backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2379
diff
changeset
|
222 } |
6538
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
223 |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
224 /** |
8856 | 225 * True if the given section is the "newest" for that river |
226 * and has values at km. | |
6538
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
227 * @param km Given station. |
8856 | 228 * @return true if the section has the most advanced end of its validity |
229 * interval or the most advanced start of its validity interval. | |
6538
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
230 */ |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
231 public boolean shouldBeMaster(double km) { |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
232 Session session = SessionHolder.HOLDER.get(); |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
233 |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
234 SQLQuery sqlQuery = session.createSQLQuery(SQL_MIN_MAX) |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
235 .addScalar("cross_section_id", StandardBasicTypes.INTEGER); |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
236 |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
237 sqlQuery |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
238 .setInteger("river_id", getRiver().getId()) |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
239 .setDouble("km", km); |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
240 |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
241 List<Integer> results = sqlQuery.list(); |
9462 | 242 final StringBuilder builder = new StringBuilder(); |
243 | |
244 | |
6852
d02ad36115c6
issue1157: Only look at the best match for CrossSections to activate.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6622
diff
changeset
|
245 if (results.size() >= 1) { |
9462 | 246 final String resultIds = results.toString(); |
247 builder.append("CrossSection line 243 ID = ").append(getId()).append(", Result SIZE = ").append(results.size()).append( ", Result_Ids = ").append(resultIds); | |
248 log.debug(builder.toString()); | |
6852
d02ad36115c6
issue1157: Only look at the best match for CrossSections to activate.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6622
diff
changeset
|
249 Integer result = results.get(0); |
6538
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
250 if (result == getId()) { |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
251 return true; |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
252 } |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
253 } |
6852
d02ad36115c6
issue1157: Only look at the best match for CrossSections to activate.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6622
diff
changeset
|
254 else { |
8200
9d2e69f971f5
sed -i src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7017
diff
changeset
|
255 log.warn("No CS found that could be master."); |
6852
d02ad36115c6
issue1157: Only look at the best match for CrossSections to activate.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6622
diff
changeset
|
256 } |
d02ad36115c6
issue1157: Only look at the best match for CrossSections to activate.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6622
diff
changeset
|
257 |
d02ad36115c6
issue1157: Only look at the best match for CrossSections to activate.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6622
diff
changeset
|
258 // TODO If there is none, might need a fallback. |
d02ad36115c6
issue1157: Only look at the best match for CrossSections to activate.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6622
diff
changeset
|
259 // Formerly this was the most current CS (issue1157). |
d02ad36115c6
issue1157: Only look at the best match for CrossSections to activate.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6622
diff
changeset
|
260 |
6538
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
261 return false; |
de62db0f2035
issue1157: Let CrossSection be able to find out whether it should be active & master.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6536
diff
changeset
|
262 } |
1194
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
263 } |
491892931761
Added Hibernate models for cross-sections and their points.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
264 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |