Mercurial > dive4elements > river
view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionFactory.java @ 1839:c3b44da22a3a
Minor refactoring in preparation of generation of interpolators (WstValueTable) for static WQKms.
flys-artifacts/trunk@3175 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 07 Nov 2011 12:37:41 +0000 |
parents | fbe18ad4caff |
children | 59622ba800c8 |
line wrap: on
line source
package de.intevation.flys.artifacts.model; import java.util.List; import de.intevation.flys.backend.SessionHolder; import de.intevation.flys.model.CrossSection; import de.intevation.flys.model.River; import org.hibernate.Session; import org.hibernate.Query; /** * Get Cross Sections. */ public class CrossSectionFactory { /** * Get CrossSections for an instantiated River. * * @param river river object. * * @return List of Cross Sections of river. */ public static List<CrossSection> getCrossSections(River river) { return getCrossSections(river.getName()); } /** * Get Cross Sections for a river by name. * * @param river name of the river of interest. * * @return List of Cross Sections of river. */ public static List<CrossSection> getCrossSections(String riverName) { Session session = SessionHolder.HOLDER.get(); Query query = session.createQuery( "from CrossSection where river.name = :rivername"); query.setParameter("rivername", riverName); return query.list(); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :