com.scooterframework.orm.misc
Class JdbcPageListSource

java.lang.Object
  extended by com.scooterframework.orm.misc.PageListSource
      extended by com.scooterframework.orm.misc.JdbcPageListSource

public class JdbcPageListSource
extends PageListSource

JdbcPageListSource class retrieves paged record list by using ActiveRecord.

The caller of this class is responsible for setting proper values for limit, offset, recount, and inputs map. Default values will be used when they are not set. The default value for limit is defined in DataProcessor.DEFAULT_PAGINATION_LIMIT. The default value for offset is zero. The default value for recount is true./

You can specify more conditional SQL query strings in the inputOptions map with key ActiveRecord.key_conditions_sql.


Field Summary
 
Fields inherited from class com.scooterframework.orm.misc.PageListSource
inputOptions, limit, log, offset, recordList, recount, totalCount
 
Constructor Summary
JdbcPageListSource(java.lang.Class<? extends ActiveRecord> modelClass)
          Constructs a PageListSource object.
JdbcPageListSource(java.lang.Class<? extends ActiveRecord> modelClass, java.util.Map<java.lang.String,java.lang.String> inputOptions)
          Constructs a PageListSource object.
JdbcPageListSource(java.lang.Class<? extends ActiveRecord> modelClass, java.util.Map<java.lang.String,java.lang.String> inputOptions, boolean recount)
          Constructs a PageListSource object.
 
Method Summary
protected  int countTotalRecords()
          Counts total number of records.
protected  java.util.List<ActiveRecord> retrieveList()
          Retrieves list of records.
 
Methods inherited from class com.scooterframework.orm.misc.PageListSource
checkOffset, execute, getLimitX, getOffset, getRecordList, getTotalCount, setInputs, setLimit, setOffset, setRecount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcPageListSource

public JdbcPageListSource(java.lang.Class<? extends ActiveRecord> modelClass)
Constructs a PageListSource object.

Parameters:
modelClass - the ActiveRecord entity type to be paginated.

JdbcPageListSource

public JdbcPageListSource(java.lang.Class<? extends ActiveRecord> modelClass,
                          java.util.Map<java.lang.String,java.lang.String> inputOptions)
Constructs a PageListSource object.

Parameters:
modelClass - the ActiveRecord entity type to be paginated.
inputOptions - Map of control information.

JdbcPageListSource

public JdbcPageListSource(java.lang.Class<? extends ActiveRecord> modelClass,
                          java.util.Map<java.lang.String,java.lang.String> inputOptions,
                          boolean recount)
Constructs a PageListSource object.

Parameters:
modelClass - the ActiveRecord entity type to be paginated.
inputOptions - Map of control information.
recount - true if recount of total records is allowed; false otherwise.
Method Detail

countTotalRecords

protected int countTotalRecords()
Description copied from class: PageListSource
Counts total number of records. May not be invoked if recounted is false.

Specified by:
countTotalRecords in class PageListSource
Returns:
total number of records

retrieveList

protected java.util.List<ActiveRecord> retrieveList()
Description copied from class: PageListSource
Retrieves list of records.

Specified by:
retrieveList in class PageListSource
Returns:
list of records