tags:

views:

342

answers:

1

I am using Hibernate 3.3.2 GA + Annotations. Is there a way get a lazy list back when calling list() on a query? The documentation (19.1.3) remarks:

list() does not usually return proxies.

The question is: how do I make it return proxies (or more perhaps more precisely one proxy which returns entity instances during the actual iteration)? Is that possible at all? How would I tune the batch size?

+1  A: 

Maybe Query.iterate is what you want?

Tadeusz Kopec
I wanted the convenience of having a collection class of (potentially) unlimited size without having to iterate explicitly. I ended up writing a lazy list which uses scrollable results internally.
yawn