org.hdpagination.dataaccess.orm.hibernate3
Class Hibernate3QueryTemplate

java.lang.Object
  extended by org.hdpagination.dataaccess.orm.hibernate3.Hibernate3QueryTemplate
All Implemented Interfaces:
QueryTemplate

public class Hibernate3QueryTemplate
extends java.lang.Object
implements QueryTemplate

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

Since:
1.0
Author:
Liangfeng Ren

Field Summary
 org.hibernate.SessionFactory sessionFactory
           
 
Constructor Summary
Hibernate3QueryTemplate(org.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 org.hibernate.SessionFactory sessionFactory
Constructor Detail

Hibernate3QueryTemplate

public Hibernate3QueryTemplate(org.hibernate.SessionFactory sessionFac)
Parameters:
sessionFac - sessionFactory of Hibernate3
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.