org.hdpagination.dataaccess.orm.hibernate2
Class Hibernate2QueryTemplate

java.lang.Object
  extended by org.hdpagination.dataaccess.orm.hibernate2.Hibernate2QueryTemplate
All Implemented Interfaces:
QueryTemplate

public class Hibernate2QueryTemplate
extends java.lang.Object
implements QueryTemplate

The type of QueryTemplate to run a pagination based query against Hibernate2.

Since:
1.0
Author:
Liangfeng Ren

Field Summary
 net.sf.hibernate.SessionFactory sessionFactory
           
 
Constructor Summary
Hibernate2QueryTemplate(net.sf.hibernate.SessionFactory sessionFac)
           
 
Method Summary
 int countRows(QueryCallback callback)
          query total number of records for this search
 java.util.List query(QueryCallback callback, int pageSize, int pageNo)
          execute query and return only one page of data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sessionFactory

public net.sf.hibernate.SessionFactory sessionFactory
Constructor Detail

Hibernate2QueryTemplate

public Hibernate2QueryTemplate(net.sf.hibernate.SessionFactory sessionFac)
Parameters:
sessionFac - sessionFactory of Hibernate2
Method Detail

query

public java.util.List query(QueryCallback callback,
                            int pageSize,
                            int pageNo)
Description copied from interface: QueryTemplate
execute query and return only one page of data

Specified by:
query in interface QueryTemplate
pageSize - number of records per page
pageNo - index of current page,index begins with 0.
Returns:

countRows

public int countRows(QueryCallback callback)
Description copied from interface: QueryTemplate
query total number of records for this search

Specified by:
countRows in interface QueryTemplate
Returns:


Copyright © 2008 HDPagination All Rights Reserved.