简体   繁体   English

使用Hibernate和Struts2进行分页实现

[英]Paging implimentation using Hibernate with Struts2

I am working on developing a paging solution using Hibernate as persistance layer and Struts2 as UI. 我正在开发使用Hibernate作为持久层和Struts2作为UI的分页解决方案。 I was following the thread Similar Thread at SO 在SO关注线程类似线程

and it seems that the answers are themself good and explanatory,i still have some query,since i can have maximum of 2-3000 records (assuming 1-2K) so its still good approach to fetch all sorted records from db and place them in a cache and impliment paging functionality on the cache records or should be something like fetch few hundered records only. 而且似乎答案本身是好的并且可以解释,我仍然有一些疑问,因为我最多可以拥有2-3000条记录(假设为1-2K),因此从db中提取所有已排序的记录并将其放在其中仍然是一种很好的方法。缓存记录上的缓存和隐式分页功能,或者应类似于仅获取一些混乱记录。 we want paging functionality what SO have so i have already my logic to impliment this,only concern is should i fetch records from DB per page request or go for some other approach. 我们想要分页功能,所以我已经有我的逻辑可以暗示这一点,唯一需要注意的是我应该按每个页面请求从数据库中获取记录还是采用其他方法。

as a note this paging functionalty is for backend management. 注意,此分页功能用于后端管理。

Thanks in advance 提前致谢

Fetch X records per page. 每页获取X条记录。 Don't pull more than you need. 不要拉超过您的需要。 Bozho's answer in that thread is best. 博佐在那个话题上的回答是最好的。

Are you having trouble implementing this? 您在执行此操作时遇到困难吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM