-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate Timesten query.setFirstResult doesnt work
PostPosted: Wed Dec 27, 2006 1:38 am 
Newbie

Joined: Wed Dec 27, 2006 12:22 am
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.