Leszek Gawron wrote:
> Simone Gianni wrote: > >> Actually we decided to use the List interface for it, and on the test >> project we have a List implementation that actually works on a Hibernate >> Criteria in a way that it's able to retrieve blocks of records from >> hibernate and ask directly to the database the size, only implementing >> some basic methods of the List interface. > > Does it fetch a whole page or a "window" with predefined size? It's initialized with new HibernateList(DetachedCriteria criteria, Session session, int fetchSize); when you call get(10) it will test if it has already fetched, if not will fetch from 10 to 10+fetchSize element. The size() method is implemented moving the cursor to the last row and returning the index of it. As told we're testing it on a 11000 very heavy object list, and it's working perfectly, we see only 10 selects done to fetch the objects when the get(x) method is first called. > > Would you be willing to make it public? > Yep. It will be part of the documentation actually, because we don't want to introduce a dependency on Hibernate in cocoon itself, anyway it's apache license so it will be public. Simone -- Simone Gianni
