-->
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.  [ 4 posts ] 
Author Message
 Post subject: Paging data
PostPosted: Wed Apr 19, 2006 7:06 am 
Newbie

Joined: Wed Apr 19, 2006 7:03 am
Posts: 2
Hello, I´m a newbie with nhibernet, I´m an asp.net developer. Is it possible
to get pages of data instead a complete dataset?, I would like to avoid the
overhead over the database with tables that contains a large amount of
records. Mostly of the web pages only show 100 rows in a grid per page, so
it is not necesary to retrieve 100000 rows when 100 is needed? how can I do
this with nhibernate?. I have seen many filters and sortings capabilities in
the library, but I think that they are after fetching the entire dataset or
resultset... Is that right?

Thanks in advance...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 19, 2006 11:00 am 
Regular
Regular

Joined: Mon May 16, 2005 1:35 am
Posts: 67
Use the SetFirstResult and SetMaxResults methods on the IQuery and ICriteria interfaces to limit the resultset. The effectiveness of these calls will depend on the features supported by the database.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 21, 2006 6:44 pm 
Newbie

Joined: Wed Apr 19, 2006 7:03 am
Posts: 2
Hello, thank you for your help, but I have another proble, how can I get the total count of elements in the table or the number of pages in order to custom page with gridview or datagrid.

Thank you


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 24, 2006 11:12 am 
Newbie

Joined: Wed Nov 23, 2005 5:44 am
Posts: 7
you will have to do a count query first using HQL


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.