comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/HYKFactory.java @ 2137:04b6b6a4564d

Prepare improved hyk-handling. flys-artifacts/trunk@3715 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 19 Jan 2012 10:51:20 +0000
parents e50a928187cd
children 923256599afe
comparison
equal deleted inserted replaced
2136:3a5ef4ac8e0f 2137:04b6b6a4564d
74 * 74 *
75 * @param column the position columns value 75 * @param column the position columns value
76 * @param wst_id database id of the wst 76 * @param wst_id database id of the wst
77 * @return according WKms. 77 * @return according WKms.
78 */ 78 */
79 // TODO we also need to know the HYK-id to specify which set we are
80 // inspecting.
79 public static List<Zone> getZonesUncached(int riverId, double km) { 81 public static List<Zone> getZonesUncached(int riverId, double km) {
80 82
81 if (logger.isDebugEnabled()) { 83 if (logger.isDebugEnabled()) {
82 logger.debug("HYKFactory.getZoneUncached " + riverId + " km " + km); 84 logger.debug("HYKFactory.getZoneUncached " + riverId + " km " + km);
83 } 85 }
84 86
85 Session session = SessionHolder.HOLDER.get(); 87 Session session = SessionHolder.HOLDER.get();
88
89 // TODO respect interval better. respect multiples (sort, limit),
90 // TODO respect flow direction of river.
86 Query query = session.createQuery( 91 Query query = session.createQuery(
87 "from HYKFormation where entry.HYK.river.id = :riverid " + 92 "from HYKFormation where entry.HYK.river.id = :riverid " +
88 " and entry.km between " + 93 " and entry.km between " +
89 ":km - cast(distance_vl/1000.0 - 0.001 as big_decimal) and " + 94 ":km - cast(distance_vl/1000.0 - 0.001 as big_decimal) and " +
90 ":km + cast(distance_vl/1000.0 + 0.001 as big_decimal)"); 95 ":km + cast(distance_vl/1000.0 + 0.001 as big_decimal)");
125 this.from = from; 130 this.from = from;
126 this.to = to; 131 this.to = to;
127 this.name = name; 132 this.name = name;
128 } 133 }
129 134
135 /** Get upper value. */
136 public double getTo() {
137 return to;
138 }
139
140 /** Get lower value. */
130 public double getFrom() { 141 public double getFrom() {
131 return from; 142 return from;
132 } 143 }
133 144
145 /** Get name (type). */
134 public String getName() { 146 public String getName() {
135 return name; 147 return name;
136 } 148 }
137 } // public static class Zone 149 } // public static class Zone
138 } 150 }

http://dive4elements.wald.intevation.org