Hi all, I'm just getting started with hibernate, and I am no DB expert...
Anyways the basic question is: Given A Query may return say 1 million rows, retrieving all 1 million records into a list..is obviously going to be memory issue. so..should the query result in in that many matching records, how can I specify a max return size?, and then or course continue the query later form the last record previous retrieved.
i.e. Doing:
Query q = session.createQuery("from BigMoFoTable");
List results = q.list();
could potentialy result in a list getting created with all the records?
(I'm assuming the list just wraps the JDBC ResultSet).
is there anyway to say do something along the lines of...
Query q = session.createQuery("from BigMoFoTable");
List results = q.list(MAX_SIZE);
.. DO WORK..
// Get the next 'batch' OF RESULTS
q.list(LAST_RESULT_SET_INDEX, MAX_SIZE);
THANX FOR ANY advice/tips, this noob will greatly appreciate it.
|