# HG changeset patch # User Ingo Weinzierl # Date 1303216267 0 # Node ID 4791fd92a20838d4ab9e2ab9c4ea02d27688de8a # Parent 0b2358bc716d80a8383d11d03f1f54066da29986 Added a factory that returns MainValues. flys-artifacts/trunk@1728 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 0b2358bc716d -r 4791fd92a208 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue Apr 19 11:05:27 2011 +0000 +++ b/flys-artifacts/ChangeLog Tue Apr 19 12:31:07 2011 +0000 @@ -1,3 +1,8 @@ +2011-04-19 Ingo Weinzierl + + * src/main/java/de/intevation/flys/artifacts/model/MainValuesFactory.java: + A factory that provides methods to return MainValues. + 2011-04-19 Sascha L. Teichmann * src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java: diff -r 0b2358bc716d -r 4791fd92a208 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/MainValuesFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/MainValuesFactory.java Tue Apr 19 12:31:07 2011 +0000 @@ -0,0 +1,29 @@ +package de.intevation.flys.artifacts.model; + +import java.util.List; + +import org.hibernate.Session; +import org.hibernate.Query; + +import de.intevation.flys.backend.SessionHolder; + +import de.intevation.flys.model.Gauge; +import de.intevation.flys.model.MainValue; + + +/** + * @author Ingo Weinzierl + */ +public class MainValuesFactory { + + public static List getMainValues(Gauge gauge) { + Session session = SessionHolder.HOLDER.get(); + + Query query = session.createQuery( + "from MainValue where gauge=:gauge"); + query.setParameter("gauge", gauge); + + return query.list(); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :