Gentlemen,
I am fairly new to Hibernate and have a question about lazy fetching. The lazy fetching of collections is very nice, but is it possible to fetch lazily on the topmost query level? In other words, if I have a Person class that contains 100,000 objects, and I do a "from Person" query, is there a way to tell hibernate to only fetch the first 1000 rows into a HashMap, and then fetch subsequent data if needed based on the index being accessed?
So, if I've fetched the initial 1000 rows into "map", and in the code I do a "map.get(1050)", this would cause Hibernate to fetch the next 1000 rows to fulfill the fetch requirements. If I did a "map.get(50010)", this would cause Hibernate to fetch records 50000-51000.
Thank you very much for your time.
Jbwiv
|