public List<T> findWithFinder(Finder finder) { Session session = getSessionFactory().getCurrentSession(); Criteria criteria = session.createCriteria( persistentClass, StringUtils.uncapitalize(persistentClass.getSimpleName())); finder.prepareCriteria(criteria, persistentClass); return criteria.list(); }
public T findWithFinderUnique(Finder finder) { Session session = getSessionFactory().getCurrentSession(); Criteria criteria = session.createCriteria(persistentClass); finder.prepareCriteria(criteria, persistentClass); return (T) criteria.uniqueResult(); }