Well, declare your page as implementor for IBasicTableModel and implement the methods. Hibernate handles paging by using setFirstResult() and setMaxResults() in the Query or Criteria class. Sorting can be handled by HQL or using the Criteria.setOrder() method.

http://blogs.warwick.ac.uk/kieranshaw/entry/hibernate_built_in/

|Query query = sess.createQuery(queryStr);
query.setMaxResults(10);
query.setFirstResult(20);
return query.list();

So it's fairly straightforward ;). There are some gotchas, as I said, but those apply whether you use IBasicTableModel or the source parameter.
|

--
Ing. Leonardo Quijano Vincenzi
DTQ Software

||
Matt Raible wrote:
On 3/29/06, Leonardo Quijano Vincenzi <[EMAIL PROTECTED]> wrote:
contrib:Table also handles sort, sort links and pagination.

For anyone interested, please do not use the "source" parameter with a
50000 element list when loading the table, just because you couldn't
find the way to use IBasicTableModel to handle pagination and sorting:
It's a performance killer, and it's *so* easy to do it right...!!

Do you have a good example of using IBasicTableModel with Hibernate -
or (even better) Spring + Hibernate?

Thanks,

Matt



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to