I read about the ScrollableResults
in Hibernate
for efficiently handling large data.
ScrollableResults results = session.createCriteria(Employee.class).scroll(); -- (1)
while (results.next()) {
Object row = results.get(0);
}
On running above, I found that select query is fired at statement (1) itself. Doesn't it mean that all the data from table is loaded into memory? If it is not the case, how does it work?
Can someone please explain.