PDA

View Full Version : Loading only part of a list



sitaro
Sep 29th, 2008, 04:41 AM
Hello.

I've got a bean with a List of beans. This list may have thousands of elements and obviously I don't want to load them all in memory at the same time. I'm using JPA (Hibernate implementation).

How can I manage to load the first elements, after using them free this memory and load the next elements and so on? I know I can do it at SQL level, but I wonder if there's a way to do it without having to put an offset in the query. A kind of semieager and semilazy load :D

Thank you very much.