# HG changeset patch # User Ingo Weinzierl # Date 1339660586 0 # Node ID d42249d91f478eca3e79fb2ff0c4afbbe1e78a95 # Parent cc8fc6b296492cfbb1e49a25d7fc9bf95468ec4d Added missing 'name' property and a new function to retrieve CrossSectionTracks. flys-backend/trunk@4654 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r cc8fc6b29649 -r d42249d91f47 flys-backend/ChangeLog --- a/flys-backend/ChangeLog Wed Jun 13 08:12:00 2012 +0000 +++ b/flys-backend/ChangeLog Thu Jun 14 07:56:26 2012 +0000 @@ -1,3 +1,9 @@ +2012-06-14 Ingo Weinzierl + + * src/main/java/de/intevation/flys/model/CrossSectionTrack.java: Added the + missing 'name' property and added a function that returns all + CrossSectionTracks of a specific river with a specific name. + 2012-06-13 Ingo Weinzierl * doc/schema/oracle-minfo.sql, diff -r cc8fc6b29649 -r d42249d91f47 flys-backend/src/main/java/de/intevation/flys/model/CrossSectionTrack.java --- a/flys-backend/src/main/java/de/intevation/flys/model/CrossSectionTrack.java Wed Jun 13 08:12:00 2012 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/model/CrossSectionTrack.java Thu Jun 14 07:56:26 2012 +0000 @@ -27,6 +27,7 @@ { private Integer id; private River river; + private String name; private LineString geom; private BigDecimal km; private BigDecimal z; @@ -59,6 +60,17 @@ } + @Column(name = "name") + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + @Column(name = "geom") @Type(type = "org.hibernatespatial.GeometryUserType") public LineString getGeom() { @@ -106,6 +118,23 @@ } + public static List getCrossSectionTrack( + String river, + String name + ) { + Session session = SessionHolder.HOLDER.get(); + + Query query = session.createQuery( + "from CrossSectionTrack as cst " + + " where river.name =:river" + + " and cst.name=:name"); + query.setParameter("river", river); + query.setParameter("name", name); + + return query.list(); + } + + /** * Returns the nearest CrossSectionTrack of river to a given * km.