有什么方法可以在 Hibernate 中处理长查询结果吗?如果我想绘制包含数百万条记录的表格并允许用户在上面导航怎么办?
目标不是把当时所有的数据都传给client,处理当前位置。
最佳答案
您可以尝试使用 Hibernate ScrollableResults ,我引用:
A result iterator that allows moving around within the results by arbitrary increments. The Query / ScrollableResults pattern is very similar to the JDBC PreparedStatement/ ResultSet pattern and the semantics of methods of this interface are similar to the similarly named methods on ResultSet.
关于java - 类似于 Hibernate 或 JPA 中的游标或记录集迭代器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12607400/