コード例 #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();
 }