comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/WKmsFactory.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 26c7aa469bfc
children 0a5239a1e46e
comparison
equal deleted inserted replaced
8855:d7c005e12af0 8856:5e38e2924c07
85 "WHERE wc.wst_id = :wst_id"; 85 "WHERE wc.wst_id = :wst_id";
86 86
87 private WKmsFactory() { 87 private WKmsFactory() {
88 } 88 }
89 89
90 public static WKms getWKms(int column, int wst_id, double from, double to) { 90 public static WKms getWKms(
91 int column,
92 int wst_id,
93 double from,
94 double to
95 ) {
91 log.debug("WKmsFactory.getWKms"); 96 log.debug("WKmsFactory.getWKms");
92 Cache cache = CacheFactory.getCache(StaticWQKmsCacheKey.CACHE_NAME); 97 Cache cache = CacheFactory.getCache(StaticWQKmsCacheKey.CACHE_NAME);
93 98
94 String cacheKey = Integer.toString(column) + ":" + Integer.toString(wst_id); 99 String cacheKey = Integer.toString(column) + ":"
100 + Integer.toString(wst_id);
95 101
96 if (cache != null) { 102 if (cache != null) {
97 if (!Double.isNaN(from) && ! Double.isNaN(to)) { 103 if (!Double.isNaN(from) && ! Double.isNaN(to)) {
98 cacheKey += ":" + Double.toString(from) + ":" + Double.toString(to); 104 cacheKey += ":" + Double.toString(from) + ":"
105 + Double.toString(to);
99 } 106 }
100 Element element = cache.get(cacheKey); 107 Element element = cache.get(cacheKey);
101 if (element != null) { 108 if (element != null) {
102 log.debug("Got static wst values from cache"); 109 log.debug("Got static wst values from cache");
103 return (WKms)element.getValue(); 110 return (WKms)element.getValue();
127 } 134 }
128 135
129 136
130 /** Get name for a WKms wrapped in W, if suitable. */ 137 /** Get name for a WKms wrapped in W, if suitable. */
131 public static String getWKmsNameWWrapped(int column, int wst_id) { 138 public static String getWKmsNameWWrapped(int column, int wst_id) {
132 log.debug("WKmsFactory.getWKmsNameWWrapped c/" + column + ", wst_id/" + wst_id); 139 log.debug("WKmsFactory.getWKmsNameWWrapped c/"
140 + column + ", wst_id/" + wst_id);
133 141
134 String name = null; 142 String name = null;
135 Session session = SessionHolder.HOLDER.get(); 143 Session session = SessionHolder.HOLDER.get();
136 144
137 SQLQuery nameQuery; 145 SQLQuery nameQuery;
190 return name; 198 return name;
191 } 199 }
192 200
193 /** Get name for a WKms. */ 201 /** Get name for a WKms. */
194 public static String getWKmsName(int column, int wst_id) { 202 public static String getWKmsName(int column, int wst_id) {
195 log.debug("WKmsFactory.getWKmsName c/" + column + ", wst_id/" + wst_id); 203 log.debug("WKmsFactory.getWKmsName c/"
204 + column + ", wst_id/" + wst_id);
196 205
197 String name = null; 206 String name = null;
198 Session session = SessionHolder.HOLDER.get(); 207 Session session = SessionHolder.HOLDER.get();
199 208
200 SQLQuery nameQuery = session.createSQLQuery(SQL_SELECT_NAME) 209 SQLQuery nameQuery = session.createSQLQuery(SQL_SELECT_NAME)
215 * Get WKms from db. 224 * Get WKms from db.
216 * @param column the position columns value 225 * @param column the position columns value
217 * @param wst_id database id of the wst 226 * @param wst_id database id of the wst
218 * @return according WKms. 227 * @return according WKms.
219 */ 228 */
220 public static WKms getWKmsUncached(int column, int wst_id, double from, double to) { 229 public static WKms getWKmsUncached(
221 230 int column,
231 int wst_id,
232 double from,
233 double to
234 ) {
222 if (log.isDebugEnabled()) { 235 if (log.isDebugEnabled()) {
223 log.debug("WKmsFactory.getWKmsUncached c/" + column + ", wst_id/" + wst_id); 236 log.debug("WKmsFactory.getWKmsUncached c/"
237 + column + ", wst_id/" + wst_id);
224 } 238 }
225 239
226 WKmsImpl wkms = new WKmsImpl(getWKmsName(column, wst_id)); 240 WKmsImpl wkms = new WKmsImpl(getWKmsName(column, wst_id));
227 241
228 Session session = SessionHolder.HOLDER.get(); 242 Session session = SessionHolder.HOLDER.get();

http://dive4elements.wald.intevation.org