please recommand some good way to do the paging.to retrieve a big list from database is vary slow. what's the best way to return only reqired subset of list for every page.I don't want to do this in database tier since I don't want to introduce column for identify the rows for page such as rownumber.
I know in Oracle there is rownum, but this is a vendor specified feature.
is there any other generic way to do this?
if I'm using HQL with hibernate, is there any way to handler it?
-
paging with hibernate (3 messages)
- Posted by: zhang zhang
- Posted on: August 19 2005 17:18 EDT
Threaded Messages (3)
- paging with hibernate by VIJAY KHANNA on August 20 2005 15:47 EDT
- Try this: by orient phoebus on September 06 2005 22:46 EDT
- Try this: by zhang zhang on September 10 2005 08:46 EDT
-
paging with hibernate[ Go to top ]
- Posted by: VIJAY KHANNA
- Posted on: August 20 2005 15:47 EDT
- in response to zhang zhang
I was having s similar requirements for implemeting Paging, column based sorting etc in a struts application and I came across this - http://displaytag.sourceforge.net/
You may try this, its extremely easy to use and is a big help in providing pagination in JSP's.
Cheers,
Vijay -
Try this:[ Go to top ]
- Posted by: orient phoebus
- Posted on: September 06 2005 22:46 EDT
- in response to zhang zhang
query=session.createQuery(hsql);
int start=(pageNog-1)*page_size;
int rowNum=page_size;
query.setFirstResult(start);
query.setMaxResults(rowNum);
offices = query.list() -
Try this:[ Go to top ]
- Posted by: zhang zhang
- Posted on: September 10 2005 08:46 EDT
- in response to orient phoebus
Thank you.
I think using this way, the habernate still need to retrieve database for all result set and convert part of result set into list.
what I like is to reitrieve only part of result from database to save retrieveing time since we have very big result set
thank you