public class CmsPagingQuery extends java.lang.Object implements I_CmsQueryFragment
CmsSelectQuery
objects which adds SQL code for results paging.The wrapper can either use the window function approach to paging or append a LIMIT/OFFSET clause.
Constructor and Description |
---|
CmsPagingQuery(CmsSelectQuery select)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
setNameSubquery(boolean nameSubquery)
Enables or disables the naming of subqueries.
|
void |
setPaging(int pageSize,
int page)
Sets both the page size and current page to use for the query.
|
void |
setUseWindowFunctions(boolean useWindowFunctions)
Enables the use of window functions.
|
void |
visit(CmsStatementBuilder builder)
Generates the SQL and parameters and sends them to the statement builder .
|
public CmsPagingQuery(CmsSelectQuery select)
select
- the wrapped querypublic void setNameSubquery(boolean nameSubquery)
nameSubquery
- if true, enables naming of subqueriespublic void setPaging(int pageSize, int page)
pageSize
- the page sizepage
- the current page (counting starts at 1)public void setUseWindowFunctions(boolean useWindowFunctions)
useWindowFunctions
- if true, enables window functionspublic void visit(CmsStatementBuilder builder)
I_CmsQueryFragment
visit
in interface I_CmsQueryFragment
builder
- the statement builderI_CmsQueryFragment.visit(org.opencms.db.CmsStatementBuilder)