The online documentation has an example here:
http://www.hibernate.org/hib_docs/v3/reference/en/html/objectstate.html#obje
ctstate-querying-executing-pagination

The Query interface has two methods: setFirstResult(int) and
setMaxResults(int).
As usual, Hibernate takes care of making sure that this will work with the
database you are using via it's 'Dialect' support.   If you want to see how
Hibernate does this for a specific database say, because you can't use
Hibernate for your project, then download the source code and have a look at
the Dialect classes.

-----Original Message-----
From: Enrique Medina [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 23, 2005 5:45 AM
To: MyFaces Discussion
Subject: Re: paginator, datatable and performance

Hi Joshua,

This is an insteresting issue. Could you give some extended information
about Hibernat'es feature of row limit?

On 4/22/05, Joshua Davis <[EMAIL PROTECTED]> wrote:
> Easy... Just use Hibernate's row limit features in conjuction with the 
> paginator.
> 
> [EMAIL PROTECTED]
> 
> --- Slawek <[EMAIL PROTECTED]> wrote:
> > hi
> >
> > suppose we have table in database containing many records (more than 
> > 10
> > 000) and we want to display them in table...
> > obiously we use paginator:)
> >
> > but we dont want to get all record form databese cause we need to 
> > wrap them "in fly" (or sth) - hevermind, lets just say that we can 
> > get at once  from datatabse only 100 records (cause our table is set 
> > to show ony 100 rows).
> > geting all 10 000 records and doing sht "in fly"
> > would kill performance:/
> >
> > but to use paginator we must get all rows (paginator "take care" 
> > about counting and so on)
> >
> > is there any poibility to use standard paginator and not fetching 
> > all rows at once from database?
> >
> > S�awek
> >
>


Reply via email to