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.  [ 3 posts ] 
Author Message
 Post subject: avoid loading of all records in a query
PostPosted: Fri Jan 19, 2007 5:28 am 
Newbie

Joined: Mon Jan 15, 2007 10:09 am
Posts: 12
Hi all,

I have a GridView which allows paging and this Grid source is a query which is to long to execute completely in only one shot. That' s why i'd like to know if i could synchronize my pagination and the records which are or will be loaded. i know there are setFirstResult() and setMaxResults() but i don't know how to know at what record i am.

I hope you will able to help me.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 22, 2007 10:59 am 
Senior
Senior

Joined: Mon Aug 21, 2006 9:18 am
Posts: 179
I typically use simple ViewState property that keeps the index of the record I am on and use that value to pass to the SetFirstResult value. Increment this value as you page firstValue+=maxValue.

_________________
If this helped...please remember to rate it!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 23, 2007 4:12 am 
Newbie

Joined: Mon Jan 15, 2007 10:09 am
Posts: 12
thanks mnichols for your answer. I was tryin' it before i asked another way to do it on the forum but i finally found another way by using ObjectDataSource methods.


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

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.