public <T> Page<T> pagedQueryByStartNo(String countHql, String hql,
int startNo, int pageSize, Object... values) {
List<T> countlist = getHibernateTemplate().find(countHql, values);
long totalCount = (Long) countlist.get(0);
if (totalCount < 1)
return new Page();
int startIndex = startNo;
Query query = createQuery(hql, values);
List<T> list = query.setFirstResult(startIndex).setMaxResults(pageSize)
.list();