comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/AnnotationsFactory.java @ 2063:97a25b54eea3

Part 1 of #125: added a description for a location to the WaterlevelExport. flys-artifacts/trunk@3557 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 02 Jan 2012 08:50:50 +0000
parents 01f2473e362d
children a5f65e8983be
comparison
equal deleted inserted replaced
2062:ed6c6d437875 2063:97a25b54eea3
47 " order by an.range.a"); 47 " order by an.range.a");
48 query.setParameter("river", river); 48 query.setParameter("river", river);
49 return query.list(); 49 return query.list();
50 } 50 }
51 51
52
53 public static Annotation getAnnotation(String river, double km) {
54 Session session = SessionHolder.HOLDER.get();
55
56 Query query = session.createQuery(
57 "from Annotation as a " +
58 "where a.range.river.name = :river AND a.range.a = :km");
59
60 query.setParameter("river", river);
61 query.setParameter("km", BigDecimal.valueOf(km));
62
63 List<Annotation> result = query.list();
64
65 return result != null && result.size() > 0 ? result.get(0) : null;
66 }
67
68
52 /** 69 /**
53 * Get minimal "a" ("from") and maximal "b" ("to") value of annotations' 70 * Get minimal "a" ("from") and maximal "b" ("to") value of annotations'
54 * ranges of a river. 71 * ranges of a river.
55 * 72 *
56 * @param river name of the river of interest. 73 * @param river name of the river of interest.

http://dive4elements.wald.intevation.org