Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/HYKFactory.java @ 3278:c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
flys-artifacts/trunk@4924 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Wed, 11 Jul 2012 09:24:07 +0000 |
parents | adb8641f5b5d |
children |
comparison
equal
deleted
inserted
replaced
3277:fc0d613e5073 | 3278:c27c4e06dd87 |
---|---|
1 package de.intevation.flys.artifacts.model; | 1 package de.intevation.flys.artifacts.model; |
2 | 2 |
3 import de.intevation.flys.artifacts.cache.CacheFactory; | |
4 import de.intevation.flys.backend.SessionHolder; | |
5 import de.intevation.flys.model.HYK; | |
6 import de.intevation.flys.model.HYKFlowZone; | |
7 import de.intevation.flys.model.HYKFormation; | |
8 | |
9 import java.io.Serializable; | |
3 import java.util.ArrayList; | 10 import java.util.ArrayList; |
4 import java.util.List; | 11 import java.util.List; |
5 | 12 |
6 import java.io.Serializable; | |
7 | |
8 import net.sf.ehcache.Cache; | 13 import net.sf.ehcache.Cache; |
9 import net.sf.ehcache.Element; | 14 import net.sf.ehcache.Element; |
10 | 15 |
11 import org.apache.log4j.Logger; | 16 import org.apache.log4j.Logger; |
12 | |
13 import org.hibernate.Query; | 17 import org.hibernate.Query; |
18 import org.hibernate.SQLQuery; | |
14 import org.hibernate.Session; | 19 import org.hibernate.Session; |
15 import org.hibernate.SQLQuery; | |
16 import org.hibernate.type.StandardBasicTypes; | 20 import org.hibernate.type.StandardBasicTypes; |
17 | |
18 import de.intevation.flys.model.HYK; | |
19 import de.intevation.flys.model.HYKFormation; | |
20 import de.intevation.flys.model.HYKFlowZone; | |
21 | |
22 import de.intevation.flys.artifacts.cache.CacheFactory; | |
23 | |
24 import de.intevation.flys.backend.SessionHolder; | |
25 | 21 |
26 | 22 |
27 /** | 23 /** |
28 * Factory to access HYKs (hydrographic values). | 24 * Factory to access HYKs (hydrographic values). |
29 */ | 25 */ |
52 if (cache != null) { | 48 if (cache != null) { |
53 cacheKey = "" + hykid + "_" + km; | 49 cacheKey = "" + hykid + "_" + km; |
54 Element element = cache.get(cacheKey); | 50 Element element = cache.get(cacheKey); |
55 if (element != null) { | 51 if (element != null) { |
56 logger.debug("Got hyk from cache"); | 52 logger.debug("Got hyk from cache"); |
57 return (List<Zone>)element.getValue(); | 53 return element.getValue(); |
58 } | 54 } |
59 } | 55 } |
60 else { | 56 else { |
61 cacheKey = null; | 57 cacheKey = null; |
62 } | 58 } |
178 | 174 |
179 return query.list(); | 175 return query.list(); |
180 } | 176 } |
181 | 177 |
182 | 178 |
183 /** Labelled section. */ | 179 /** Labeled section. */ |
184 public static class Zone implements Serializable { | 180 public static class Zone implements Serializable { |
185 /** Lower end of segment. */ | 181 /** Lower end of segment. */ |
186 protected double from; | 182 protected double from; |
187 /** Upper end of segment. */ | 183 /** Upper end of segment. */ |
188 protected double to; | 184 protected double to; |