예제 #1
0
 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();
 }
예제 #2
0
 public T findWithFinderUnique(Finder finder) {
   Session session = getSessionFactory().getCurrentSession();
   Criteria criteria = session.createCriteria(persistentClass);
   finder.prepareCriteria(criteria, persistentClass);
   return (T) criteria.uniqueResult();
 }