dev@woodstock.java.net

DataProviders, JPA and Tables

From: Lilianne E. Blaze <lilianne_blaze_at_tlen.pl>
Date: Thu, 16 Aug 2007 05:46:23 +0200

Hello,
Either they're designed for something else entirely, or I'm missing
something :/
Consider the following scenario: a table with a list of users. Suppose
it's up to 10.000 users, and it's page size is 25. Each row contains
some basic data, plus some data which is calculated as needed and has to
be done on object-by-object basis.
Now, if I got it right, a "normal" DataProvider would require to get
everything from a db, then sort it, then provide only the current 25. Is
that correct?
After reading the source I believe I can write, relatively easy, a
DataProvider which, for example, when asked for 26th object lazily loads
objects 25-50, doing sorting and limiting to page size on JPA's
entityManager, while never actually containing more than visible at the
moment. But I'm feeling I'm reinventing the wheel here, there should be
support for such scenario, and I just can't see it. What am I missing here?

Greetings, Lilianne E. Blaze