Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/Gauge.java @ 2381:aa777d1aba38
Added a function Gauge.getGaugeByOfficialNumber() that returns a Gauge based on its official number.
flys-backend/trunk@3702 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 18 Jan 2012 09:26:54 +0000 |
parents | fe89d6cf55fb |
children | 83abe19d4f40 |
comparison
equal
deleted
inserted
replaced
2380:e237a08acf6e | 2381:aa777d1aba38 |
---|---|
211 return mainValues; | 211 return mainValues; |
212 } | 212 } |
213 | 213 |
214 public void setMainValues(List<MainValue> mainValues) { | 214 public void setMainValues(List<MainValue> mainValues) { |
215 this.mainValues = mainValues; | 215 this.mainValues = mainValues; |
216 } | 216 } |
217 | |
218 | |
219 public static Gauge getGaugeByOfficialNumber(long number) { | |
220 Session session = SessionHolder.HOLDER.get(); | |
221 | |
222 Query query = session.createQuery( | |
223 "from Gauge where officialNumber=:number"); | |
224 | |
225 query.setParameter("number", number); | |
226 | |
227 List<Gauge> results = query.list(); | |
228 | |
229 return results.isEmpty() ? null : results.get(0); | |
230 } | |
217 } | 231 } |
218 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 232 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |