public List findByPage(int pageNo,int pageSize)
{
try
{
Session session=HibernateSessionFactory.getSession();
Transaction tx=session.beginTransaction();
String hql="from Student";
Query query=session.createQuery(hql);
query.setFirstResult((pageNo-1)*pageSize);
query.setMaxResults(pageSize);
return query.list();
}
catch (RuntimeException e)
{
throw e;
// TODO: handle exception
}
}