HelloDoes anyone find a way to do that? Thanks> I've read the link you
provide. This lets you retrieve from N to M
records instead of every record that matches the criteria you're
asking for.
But in the case of pagination, once the dataScroller has arrived to
the last record in the subset you have recovered from DB, how can you
tell the component to continue retrieving more records (if they are
available)? And also, if you only get a subset, how can the
dataScroller now how many records are in total to show you the
pagination?
I've been thinking in this lazy pagination solution, and it would be
perfect whether Hibernate could fecth in blocks. I mean, when you
assign your Hibernate collection to the dataScroller, instead of
materializing all the records, just materialize, for example, 100 (out
of 10000). And then, when the next block is needed, lazy load it, and
so on...
What do you think?
On 4/23/05, Joshua Davis <[EMAIL PROTECTED]> wrote:
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
> >
>
____________________________________________________
Yahoo! Mail, cada vez melhor: agora com 1GB de espa�o gr�tis!
http://mail.yahoo.com.br