Something like cursor or recordset iterator in Hibernate or JPA?
问题 Are there any means to work with long query results in Hibernate? What if I want to draw table with million of records and allow user to navigate over it? The goal is not to transfer all data to client at the time and handle the current position. 回答1: You can use simple mechanism of FirstResult and MaxResults in a Query object. query.setFirstResult(5); query.setMaxResults(5); Above will fetch 5 records from fifth record. You can use ScrollableResults but it will be slower compared to above