All entries for Tuesday 26 October 2004
October 26, 2004
Didn't realise this until just now, but Hibernate has built in paging support.
Query query = sess.createQuery(queryStr);
This handy little snippet will automagically return 10 objects, starting at object 20. And of course, chances are that hibernate has actually got all the objects you want in memory anyway, so it'll probably never even touch the database. Lovely.
In case anyone wondered, this means that there'll soon be "Older entries" and "Newer entries" links at the bottom of pages listing lots of entries.