Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FixingsColumnFactory.java @ 2673:0143b44631cc
Beginnings of mittlere hoehe calculation.
flys-artifacts/trunk@4367 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 09 May 2012 19:03:54 +0000 |
parents | 8bc1e1cb7f7b |
children | a441be7f1589 |
rev | line source |
---|---|
2615
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model; |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import de.intevation.flys.artifacts.model.FixingsOverview.Fixing; |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 |
2619
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
5 import de.intevation.flys.artifacts.cache.CacheFactory; |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
6 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
7 import de.intevation.flys.backend.SessionHolder; |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
8 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
9 import java.util.List; |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
10 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
11 import net.sf.ehcache.Cache; |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
12 import net.sf.ehcache.Element; |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
13 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
14 import org.hibernate.Session; |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
15 import org.hibernate.SQLQuery; |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
16 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
17 import org.hibernate.type.StandardBasicTypes; |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
18 |
2622
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
19 import org.apache.log4j.Logger; |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
20 |
2615
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 public class FixingsColumnFactory |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 { |
2622
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
23 private static Logger log = Logger.getLogger(FixingsColumnFactory.class); |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
24 |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
25 public static final String CACHE_NAME = "fixings-columns"; |
2615
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 |
2619
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
27 public static final String SQL_COLUMN_WS = |
2615
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 "SELECT wcv.position AS km, wcv.w AS w " + |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 "FROM wst_column_values wcv " + |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 "WHERE wst_column_id = :column_id " + |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 "ORDER by wcv.position"; |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 |
2619
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
33 public static final String SQL_COLUMN_QS = |
2615
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 "SELECT wqr.q AS q, r.a AS a, r.b AS b " + |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 "FROM wst_column_q_ranges wcqr " + |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 "JOIN wst_q_ranges wqr ON wcqr.wst_q_range_id = wqr.id " + |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 "JOIN ranges r ON wqr.range_id = r.id " + |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 "WHERE wcqr.wst_column_id = :column_id ORDER by r.a"; |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 public static final FixingsColumnFactory INSTANCE = |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 new FixingsColumnFactory(); |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 private FixingsColumnFactory() { |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 } |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 public FixingsColumn getColumnData(Fixing.Column column) { |
2619
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
47 |
2622
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
48 boolean debug = log.isDebugEnabled(); |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
49 |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
50 if (debug) { |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
51 log.debug("FixingsColumnFactory.getColumnData"); |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
52 } |
2619
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
53 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
54 Cache cache = CacheFactory.getCache(CACHE_NAME); |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
55 |
2622
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
56 if (cache == null) { |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
57 if (debug) { |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
58 log.debug("Cache unconfigured."); |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
59 } |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
60 return getUncached(column); |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
61 } |
2619
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
62 |
2622
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
63 Integer cacheKey = Integer.valueOf(column.getId()); |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
64 Element element = cache.get(cacheKey); |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
65 |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
66 if (element != null) { |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
67 if (debug) { |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
68 log.debug("Column " + cacheKey + " found in cache."); |
2619
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
69 } |
2622
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
70 return (FixingsColumn)element.getValue(); |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
71 } |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
72 else { |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
73 FixingsColumn result = getUncached(column); |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
74 if (result != null) { |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
75 if (debug) { |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
76 log.debug("Store column " + cacheKey + " into cache."); |
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
77 } |
2620
cc0fa1798a3c
FixingsKMChartService: Generate chart and deliver the image as the response of the service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2619
diff
changeset
|
78 cache.put(new Element(cacheKey, result)); |
cc0fa1798a3c
FixingsKMChartService: Generate chart and deliver the image as the response of the service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2619
diff
changeset
|
79 } |
2622
8bc1e1cb7f7b
Fixed the fixings columns caching problem.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2620
diff
changeset
|
80 return result; |
2619
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
81 } |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
82 } |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
83 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
84 protected FixingsColumn getUncached(Fixing.Column column) { |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
85 Session session = SessionHolder.HOLDER.get(); |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
86 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
87 SQLQuery sqlQuery = session.createSQLQuery(SQL_COLUMN_WS) |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
88 .addScalar("km", StandardBasicTypes.DOUBLE) |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
89 .addScalar("w", StandardBasicTypes.DOUBLE); |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
90 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
91 sqlQuery.setInteger("column_id", column.getId()); |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
92 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
93 List<Object []> results = sqlQuery.list(); |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
94 |
2620
cc0fa1798a3c
FixingsKMChartService: Generate chart and deliver the image as the response of the service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2619
diff
changeset
|
95 if (results.isEmpty()) { |
cc0fa1798a3c
FixingsKMChartService: Generate chart and deliver the image as the response of the service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2619
diff
changeset
|
96 return null; |
cc0fa1798a3c
FixingsKMChartService: Generate chart and deliver the image as the response of the service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2619
diff
changeset
|
97 } |
cc0fa1798a3c
FixingsKMChartService: Generate chart and deliver the image as the response of the service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2619
diff
changeset
|
98 |
2619
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
99 double [] kms = new double[results.size()]; |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
100 double [] ws = new double[kms.length]; |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
101 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
102 for (int i = 0; i < kms.length; ++i) { |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
103 Object [] row = results.get(i); |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
104 kms[i] = ((Double)row[0]).doubleValue(); |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
105 ws [i] = ((Double)row[1]).doubleValue(); |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
106 } |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
107 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
108 sqlQuery = session.createSQLQuery(SQL_COLUMN_QS) |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
109 .addScalar("q", StandardBasicTypes.DOUBLE) |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
110 .addScalar("a", StandardBasicTypes.DOUBLE) |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
111 .addScalar("b", StandardBasicTypes.DOUBLE); |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
112 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
113 sqlQuery.setInteger("column_id", column.getId()); |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
114 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
115 results = sqlQuery.list(); |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
116 |
2620
cc0fa1798a3c
FixingsKMChartService: Generate chart and deliver the image as the response of the service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2619
diff
changeset
|
117 if (results.isEmpty()) { |
cc0fa1798a3c
FixingsKMChartService: Generate chart and deliver the image as the response of the service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2619
diff
changeset
|
118 return null; |
cc0fa1798a3c
FixingsKMChartService: Generate chart and deliver the image as the response of the service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2619
diff
changeset
|
119 } |
cc0fa1798a3c
FixingsKMChartService: Generate chart and deliver the image as the response of the service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2619
diff
changeset
|
120 |
2619
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
121 QRangeTree qs = new QRangeTree( |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
122 results, QRangeTree.WITHOUT_COLUMN, 0, results.size()); |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
123 |
6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2615
diff
changeset
|
124 return new FixingsColumn(kms, ws, qs); |
2615
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
125 } |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
126 } |
b0597a63fe70
More code for the fixings km chart service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
127 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |