我是个新手。我使用显示标签1.2,struts2和hibernate。显示标签工作得很好,除了每当我点击下一页时,它就会抓取整个db行。我发现我必须使用显示标签的外部分页。因为我是个新手,所以任何外部分页的完整例子都会被占用。
发布于 2012-10-16 12:20:25
我对paginatedList有一些问题
这是我以前在页面上显示列表的hibernate方法。
public List<TXT_Beans> regenerateListData(int cust_Id)
{
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
String sqlQuery=null;
List<TXT_Beans> txtList = new ArrayList<TXT_Beans>();
try
{
sqlQuery="select `accounts`.`account_id`,`customer_information`.`customer_unique_enroll_id`,`accounts`.`branch_id`,csp_information`.`bc_csp_code`,`csp_information`.`csp_alpha_id`,`customer_information`.`first_name`,from `customer_information` join `customer_accounts_xref` using (customer_unique_enroll_id) WHERE`customer_accounts_xref`.`customer_unique_enroll_id`="+cust_Id;
session.beginTransaction();..这是我在显示标记获取整行时的前一次查询。现在,如何修改这种情况,使我只能获取指定的否。行,而不是整个db使用显示标记,无需排序。
发布于 2012-11-02 05:45:16
外部分页是四个步骤的过程。
total result count,除以页面大小,并在UI中显示页码。pageNumber进行数据库调用,以检索数据以及筛选条件(如果有从服务器组件),例如您的hibernatepagesize * pagenumber +1到pagesize * (pagenumber+1)检索记录并返回。这称为分页结果。paged result,并选择pagenumber。https://stackoverflow.com/questions/12891238
复制相似问题