public abstract class AbstractSqlPagingQueryProvider extends java.lang.Object implements PagingQueryProvider
Constructor and Description |
---|
AbstractSqlPagingQueryProvider() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
generateFirstPageQuery(int pageSize)
Method generating the query string to be used for retrieving the first
page.
|
abstract java.lang.String |
generateJumpToItemQuery(int itemIndex,
int pageSize)
Method generating the query string to be used for jumping to a specific
item position.
|
abstract java.lang.String |
generateRemainingPagesQuery(int pageSize)
Method generating the query string to be used for retrieving the pages
following the first page.
|
protected java.lang.String |
getFromClause() |
java.lang.String |
getGroupClause()
The getter for the group by clause
|
int |
getParameterCount()
The number of parameters that are declared in the query
|
protected java.lang.String |
getSelectClause() |
java.lang.String |
getSortKeyPlaceHolder(java.lang.String keyName)
The sort key placeholder will vary depending on whether named parameters
or traditional placeholders are used in query strings.
|
java.util.Map<java.lang.String,Order> |
getSortKeys()
A Map<String, Boolean> of sort columns as the key and boolean for ascending/descending (ascending = true).
|
java.util.Map<java.lang.String,Order> |
getSortKeysWithoutAliases()
The sort key (unique single column name) without alias.
|
protected java.lang.String |
getWhereClause() |
void |
init(javax.sql.DataSource dataSource)
Check mandatory properties.
|
boolean |
isUsingNamedParameters()
Indicate whether the generated queries use named parameter syntax.
|
void |
setFromClause(java.lang.String fromClause) |
void |
setGroupClause(java.lang.String groupClause)
The setter for the group by clause
|
void |
setSelectClause(java.lang.String selectClause) |
void |
setSortKeys(java.util.Map<java.lang.String,Order> sortKeys) |
void |
setWhereClause(java.lang.String whereClause) |
public void setGroupClause(java.lang.String groupClause)
groupClause
- SQL GROUP BY clause part of the SQL query stringpublic java.lang.String getGroupClause()
public void setSelectClause(java.lang.String selectClause)
selectClause
- SELECT clause part of SQL query stringprotected java.lang.String getSelectClause()
public void setFromClause(java.lang.String fromClause)
fromClause
- FROM clause part of SQL query stringprotected java.lang.String getFromClause()
public void setWhereClause(java.lang.String whereClause)
whereClause
- WHERE clause part of SQL query stringprotected java.lang.String getWhereClause()
public void setSortKeys(java.util.Map<java.lang.String,Order> sortKeys)
sortKeys
- key to use to sort and limit page contentpublic java.util.Map<java.lang.String,Order> getSortKeys()
getSortKeys
in interface PagingQueryProvider
public int getParameterCount()
PagingQueryProvider
getParameterCount
in interface PagingQueryProvider
public boolean isUsingNamedParameters()
PagingQueryProvider
isUsingNamedParameters
in interface PagingQueryProvider
public java.lang.String getSortKeyPlaceHolder(java.lang.String keyName)
getSortKeyPlaceHolder
in interface PagingQueryProvider
keyName
- The sort key namepublic void init(javax.sql.DataSource dataSource) throws java.lang.Exception
init
in interface PagingQueryProvider
dataSource
- DataSource to use for any initializationjava.lang.Exception
- for errors when initializingInitializingBean.afterPropertiesSet()
public abstract java.lang.String generateFirstPageQuery(int pageSize)
generateFirstPageQuery
in interface PagingQueryProvider
pageSize
- number of rows to read per pagepublic abstract java.lang.String generateRemainingPagesQuery(int pageSize)
generateRemainingPagesQuery
in interface PagingQueryProvider
pageSize
- number of rows to read per pagepublic abstract java.lang.String generateJumpToItemQuery(int itemIndex, int pageSize)
generateJumpToItemQuery
in interface PagingQueryProvider
itemIndex
- the index of the item to jump topageSize
- number of rows to read per pagepublic java.util.Map<java.lang.String,Order> getSortKeysWithoutAliases()
PagingQueryProvider
getSortKeysWithoutAliases
in interface PagingQueryProvider