Package org.opencms.db
Class CmsPagingQuery
java.lang.Object
org.opencms.db.CmsPagingQuery
- All Implemented Interfaces:
I_CmsQueryFragment
Wrapper for
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.
- Since:
- 8.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetNameSubquery(boolean nameSubquery) Enables or disables the naming of subqueries.voidsetPaging(int pageSize, int page) Sets both the page size and current page to use for the query.voidsetUseWindowFunctions(boolean useWindowFunctions) Enables the use of window functions.voidvisit(CmsStatementBuilder builder) Generates the SQL and parameters and sends them to the statement builder .
-
Constructor Details
-
CmsPagingQuery
Creates a new instance.- Parameters:
select- the wrapped query
-
-
Method Details
-
setNameSubquery
Enables or disables the naming of subqueries.- Parameters:
nameSubquery- if true, enables naming of subqueries
-
setPaging
Sets both the page size and current page to use for the query.- Parameters:
pageSize- the page sizepage- the current page (counting starts at 1)
-
setUseWindowFunctions
Enables the use of window functions.- Parameters:
useWindowFunctions- if true, enables window functions
-
visit
Description copied from interface:I_CmsQueryFragmentGenerates the SQL and parameters and sends them to the statement builder .- Specified by:
visitin interfaceI_CmsQueryFragment- Parameters:
builder- the statement builder- See Also:
-