From: <fc...@us...> - 2008-06-09 16:46:23
|
Revision: 830 http://openutils.svn.sourceforge.net/openutils/?rev=830&view=rev Author: fcarone Date: 2008-06-09 09:46:26 -0700 (Mon, 09 Jun 2008) Log Message: ----------- findFilteredFirst with order added Modified Paths: -------------- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java Modified: trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java 2008-06-08 11:47:36 UTC (rev 829) +++ trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java 2008-06-09 16:46:26 UTC (rev 830) @@ -193,6 +193,14 @@ * Return the first object related to the implementation of this DAO filtered using properties of the provided * instance. * @param filter an instance of the object with the properties you whish to filter on. + * @return first object in the collection + */ + T findFilteredFirst(final T filter, final Order[] order); + + /** + * Return the first object related to the implementation of this DAO filtered using properties of the provided + * instance. + * @param filter an instance of the object with the properties you whish to filter on. * @param criteria additional criterion * @return first object in the collection */ Modified: trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2008-06-08 11:47:36 UTC (rev 829) +++ trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2008-06-09 16:46:26 UTC (rev 830) @@ -276,6 +276,15 @@ /** * {@inheritDoc} */ + public T findFilteredFirst(final T filter, final Order[] order) + { + return getFirstInCollection(findFiltered(filter, order, getDefaultFilterMetadata(), 1, 0)); + } + + + /** + * {@inheritDoc} + */ public T findFilteredFirst(final T filter, List<Criterion> criteria) { return getFirstInCollection(findFiltered(filter, null, getDefaultFilterMetadata(), 1, 0, criteria)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |