接口 PagingQueryProvider
- 所有已知实现类:
AbstractSqlPagingQueryProvider
,Db2PagingQueryProvider
,DerbyPagingQueryProvider
,H2PagingQueryProvider
,HsqlPagingQueryProvider
,MySqlPagingQueryProvider
,OraclePagingQueryProvider
,PostgresPagingQueryProvider
,SqlitePagingQueryProvider
,SqlServerPagingQueryProvider
,SqlWindowingPagingQueryProvider
,SybasePagingQueryProvider
public interface PagingQueryProvider
Interface defining the functionality to be provided for generating paging queries for use with Paging Item Readers.- 从以下版本开始:
- 2.0
- 作者:
- Thomas Risberg, Michael Minella
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 java.lang.String
generateFirstPageQuery(int pageSize)
Generate the query that will provide the first page, limited by the page size.java.lang.String
generateJumpToItemQuery(int itemIndex, int pageSize)
Generate the query that will provide the jump to item query.java.lang.String
generateRemainingPagesQuery(int pageSize)
Generate the query that will provide the first page, limited by the page size.int
getParameterCount()
The number of parameters that are declared in the queryjava.lang.String
getSortKeyPlaceHolder(java.lang.String keyName)
Returns either a String to be used as the named placeholder for a sort key value (based on the column name) or a ?java.util.Map<java.lang.String,Order>
getSortKeys()
The sort keys.java.util.Map<java.lang.String,Order>
getSortKeysWithoutAliases()
The sort key (unique single column name) without alias.void
init(javax.sql.DataSource dataSource)
Initialize the query provider using the providedDataSource
if necessary.boolean
isUsingNamedParameters()
Indicate whether the generated queries use named parameter syntax.
方法详细资料
init
void init(javax.sql.DataSource dataSource) throws java.lang.Exception
Initialize the query provider using the providedDataSource
if necessary.- 参数:
dataSource
- DataSource to use for any initialization- 抛出:
java.lang.Exception
- for errors when initializing
generateFirstPageQuery
java.lang.String generateFirstPageQuery(int pageSize)
Generate the query that will provide the first page, limited by the page size.- 参数:
pageSize
- number of rows to read for each page- 返回:
- the generated query
generateRemainingPagesQuery
java.lang.String generateRemainingPagesQuery(int pageSize)
Generate the query that will provide the first page, limited by the page size.- 参数:
pageSize
- number of rows to read for each page- 返回:
- the generated query
generateJumpToItemQuery
java.lang.String generateJumpToItemQuery(int itemIndex, int pageSize)
Generate the query that will provide the jump to item query. The itemIndex provided could be in the middle of the page and together with the page size it will be used to calculate the last index of the preceding page to be able to retrieve the sort key for this row.- 参数:
itemIndex
- the index for the next item to be readpageSize
- number of rows to read for each page- 返回:
- the generated query
getParameterCount
int getParameterCount()
The number of parameters that are declared in the query- 返回:
- number of parameters
isUsingNamedParameters
boolean isUsingNamedParameters()
Indicate whether the generated queries use named parameter syntax.- 返回:
- true if named parameter syntax is used
getSortKeys
java.util.Map<java.lang.String,Order> getSortKeys()
The sort keys. A Map of the columns that make up the key and a Boolean indicating ascending or descending (ascending = true).- 返回:
- the sort keys used to order the query
getSortKeyPlaceHolder
java.lang.String getSortKeyPlaceHolder(java.lang.String keyName)
Returns either a String to be used as the named placeholder for a sort key value (based on the column name) or a ? for unnamed parameters.- 参数:
keyName
- The sort key name- 返回:
- The string to be used for a parameterized query.
getSortKeysWithoutAliases
java.util.Map<java.lang.String,Order> getSortKeysWithoutAliases()
The sort key (unique single column name) without alias.- 返回:
- the sort key used to order the query (without alias)