Hi guys,
Im creating a pagination class for all my queries, using hibernate 3.1 and oracle timesten 6.0.2. When the code goes like this
Code:
criteria = "from UsersVO";
Session session = getSessionFactory().getCurrentSession();
Query query = session.createQuery(criteria);
List results = query.list();
System.out.prinltln("Record size: "+results.size());
I get 7 from the result size. But if I added the methods for pagination Ill always get a 0 result size.
Code:
criteria = "from UsersVO";
pageSize = 5;
page = 1;
Query query = session.createQuery(criteria);
query.setFirstResult(pageSize * page);
query.setMaxResults(pageSize+1);
System.out.prinltln("Record size: "+results.size());
Thanks in Advance.