Mercurial > dive4elements > river
changeset 7286:dd8103e8ee5b
issue1512: Added method to get FlowVelocityModel by id.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 11 Oct 2013 10:30:26 +0200 |
parents | 8c315b6bbc8a |
children | 836411185200 |
files | backend/src/main/java/org/dive4elements/river/model/FlowVelocityModel.java |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/model/FlowVelocityModel.java Fri Oct 11 10:29:37 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/model/FlowVelocityModel.java Fri Oct 11 10:30:26 2013 +0200 @@ -110,5 +110,17 @@ return query.list(); } + + public static FlowVelocityModel getModel(int id) { + + Session session = SessionHolder.HOLDER.get(); + + Query query = session.createQuery( + "from FlowVelocityModel where id=:id"); + + query.setParameter("id", id); + + return (FlowVelocityModel) query.list().get(0); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :