public class SqlPagingQueryUtils
extends java.lang.Object
Constructor and Description |
---|
SqlPagingQueryUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
buildSortClause(AbstractSqlPagingQueryProvider provider)
Generates ORDER BY attributes based on the sort keys.
|
static java.lang.String |
buildSortClause(java.util.Map<java.lang.String,Order> sortKeys)
Generates ORDER BY attributes based on the sort keys.
|
static void |
buildSortConditions(AbstractSqlPagingQueryProvider provider,
java.lang.StringBuilder sql)
Appends the where conditions required to query for the subsequent pages.
|
static java.lang.String |
generateGroupedTopSqlQuery(AbstractSqlPagingQueryProvider provider,
boolean remainingPageQuery,
java.lang.String topClause)
Generate SQL query string using a TOP clause
|
static java.lang.String |
generateLimitGroupedSqlQuery(AbstractSqlPagingQueryProvider provider,
boolean remainingPageQuery,
java.lang.String limitClause)
Generate SQL query string using a LIMIT clause
|
static java.lang.String |
generateLimitJumpToQuery(AbstractSqlPagingQueryProvider provider,
java.lang.String limitClause)
Generate SQL query string using a LIMIT clause
|
static java.lang.String |
generateLimitSqlQuery(AbstractSqlPagingQueryProvider provider,
boolean remainingPageQuery,
java.lang.String limitClause)
Generate SQL query string using a LIMIT clause
|
static java.lang.String |
generateRowNumSqlQuery(AbstractSqlPagingQueryProvider provider,
boolean remainingPageQuery,
java.lang.String rowNumClause)
Generate SQL query string using a ROW_NUM condition
|
static java.lang.String |
generateRowNumSqlQuery(AbstractSqlPagingQueryProvider provider,
java.lang.String selectClause,
boolean remainingPageQuery,
java.lang.String rowNumClause)
Generate SQL query string using a ROW_NUM condition
|
static java.lang.String |
generateRowNumSqlQueryWithNesting(AbstractSqlPagingQueryProvider provider,
java.lang.String selectClause,
boolean remainingPageQuery,
java.lang.String rowNumClause) |
static java.lang.String |
generateRowNumSqlQueryWithNesting(AbstractSqlPagingQueryProvider provider,
java.lang.String innerSelectClause,
java.lang.String outerSelectClause,
boolean remainingPageQuery,
java.lang.String rowNumClause) |
static java.lang.String |
generateTopJumpToQuery(AbstractSqlPagingQueryProvider provider,
java.lang.String topClause)
Generate SQL query string using a TOP clause
|
static java.lang.String |
generateTopSqlQuery(AbstractSqlPagingQueryProvider provider,
boolean remainingPageQuery,
java.lang.String topClause)
Generate SQL query string using a TOP clause
|
public static java.lang.String generateLimitSqlQuery(AbstractSqlPagingQueryProvider provider, boolean remainingPageQuery, java.lang.String limitClause)
provider
- AbstractSqlPagingQueryProvider
providing the
implementation specificsremainingPageQuery
- is this query for the remaining pages (true) as
opposed to the first page (false)limitClause
- the implementation specific limit clause to be usedpublic static java.lang.String generateLimitGroupedSqlQuery(AbstractSqlPagingQueryProvider provider, boolean remainingPageQuery, java.lang.String limitClause)
provider
- AbstractSqlPagingQueryProvider
providing the
implementation specificsremainingPageQuery
- is this query for the remaining pages (true) as
opposed to the first page (false)limitClause
- the implementation specific limit clause to be usedpublic static java.lang.String generateTopSqlQuery(AbstractSqlPagingQueryProvider provider, boolean remainingPageQuery, java.lang.String topClause)
provider
- AbstractSqlPagingQueryProvider
providing the
implementation specificsremainingPageQuery
- is this query for the remaining pages (true) as
opposed to the first page (false)topClause
- the implementation specific top clause to be usedpublic static java.lang.String generateGroupedTopSqlQuery(AbstractSqlPagingQueryProvider provider, boolean remainingPageQuery, java.lang.String topClause)
provider
- AbstractSqlPagingQueryProvider
providing the
implementation specificsremainingPageQuery
- is this query for the remaining pages (true) as
opposed to the first page (false)topClause
- the implementation specific top clause to be usedpublic static java.lang.String generateRowNumSqlQuery(AbstractSqlPagingQueryProvider provider, boolean remainingPageQuery, java.lang.String rowNumClause)
provider
- AbstractSqlPagingQueryProvider
providing the
implementation specificsremainingPageQuery
- is this query for the remaining pages (true) as
opposed to the first page (false)rowNumClause
- the implementation specific row num clause to be usedpublic static java.lang.String generateRowNumSqlQuery(AbstractSqlPagingQueryProvider provider, java.lang.String selectClause, boolean remainingPageQuery, java.lang.String rowNumClause)
provider
- AbstractSqlPagingQueryProvider
providing the
implementation specificsselectClause
- String
containing the select portion of the query.remainingPageQuery
- is this query for the remaining pages (true) as
opposed to the first page (false)rowNumClause
- the implementation specific row num clause to be usedpublic static java.lang.String generateRowNumSqlQueryWithNesting(AbstractSqlPagingQueryProvider provider, java.lang.String selectClause, boolean remainingPageQuery, java.lang.String rowNumClause)
public static java.lang.String generateRowNumSqlQueryWithNesting(AbstractSqlPagingQueryProvider provider, java.lang.String innerSelectClause, java.lang.String outerSelectClause, boolean remainingPageQuery, java.lang.String rowNumClause)
public static java.lang.String generateLimitJumpToQuery(AbstractSqlPagingQueryProvider provider, java.lang.String limitClause)
provider
- AbstractSqlPagingQueryProvider
providing the
implementation specificslimitClause
- the implementation specific top clause to be usedpublic static java.lang.String generateTopJumpToQuery(AbstractSqlPagingQueryProvider provider, java.lang.String topClause)
provider
- AbstractSqlPagingQueryProvider
providing the
implementation specificstopClause
- the implementation specific top clause to be usedpublic static java.lang.String buildSortClause(AbstractSqlPagingQueryProvider provider)
provider
- the AbstractSqlPagingQueryProvider
to be used for
used for pagination.public static java.lang.String buildSortClause(java.util.Map<java.lang.String,Order> sortKeys)
sortKeys
- Map
where the key is the name of the column to be
sorted and the value contains the Order
.public static void buildSortConditions(AbstractSqlPagingQueryProvider provider, java.lang.StringBuilder sql)
provider
- the AbstractSqlPagingQueryProvider
to be used for
pagination.sql
- StringBuilder
containing the sql to be used for the
query.