Package org.alfresco.query
Class CannedQueryParameters
java.lang.Object
org.alfresco.query.CannedQueryParameters
Parameters defining the
named query
to execute.
The implementations of the underlying queries may be vastly different
depending on seemingly-minor variations in the parameters; only set the
parameters that are required.- Since:
- 4.0
- Author:
- Derek Hulley
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCannedQueryParameters
(Object parameterBean) pageDetails: null sortDetails: null totalResultCountMax: 0 queryExecutionId: nullCannedQueryParameters
(Object parameterBean, int skipResults, int pageSize, String queryExecutionId) Defaults: pageDetails.pageNumber: 1 pageDetails.pageCount: 1 totalResultCountMax: 0CannedQueryParameters
(Object parameterBean, CannedQueryPageDetails pageDetails, CannedQuerySortDetails sortDetails) Defaults: totalResultCountMax: 0 queryExecutionId: nullCannedQueryParameters
(Object parameterBean, CannedQueryPageDetails pageDetails, CannedQuerySortDetails sortDetails, int totalResultCountMax, String queryExecutionId) Construct all the parameters for executing a named query.CannedQueryParameters
(Object parameterBean, CannedQuerySortDetails sortDetails, PagingRequest pagingRequest) Construct all the parameters for executing a named query, using values from thePagingRequest
. -
Method Summary
Modifier and TypeMethodDescriptionint
Helper method to get the total number of query results that need to be obtained in order to satisfy thepaging requirements
, the maximum result count ...int
toString()
-
Field Details
-
DEFAULT_TOTAL_COUNT_MAX
public static final int DEFAULT_TOTAL_COUNT_MAX- See Also:
-
-
Constructor Details
-
CannedQueryParameters
- pageDetails: null
- sortDetails: null
- totalResultCountMax: 0
- queryExecutionId: null
-
CannedQueryParameters
public CannedQueryParameters(Object parameterBean, int skipResults, int pageSize, String queryExecutionId) Defaults:- pageDetails.pageNumber: 1
- pageDetails.pageCount: 1
- totalResultCountMax: 0
-
CannedQueryParameters
public CannedQueryParameters(Object parameterBean, CannedQueryPageDetails pageDetails, CannedQuerySortDetails sortDetails) Defaults:- totalResultCountMax: 0
- queryExecutionId: null
-
CannedQueryParameters
public CannedQueryParameters(Object parameterBean, CannedQuerySortDetails sortDetails, PagingRequest pagingRequest) Construct all the parameters for executing a named query, using values from thePagingRequest
.- Parameters:
parameterBean
- the values that the query will be based on or null if not relevant to the querysortDetails
- the type of sorting to be applied or null for nonepagingRequest
- the type of paging to be applied or null for none
-
CannedQueryParameters
public CannedQueryParameters(Object parameterBean, CannedQueryPageDetails pageDetails, CannedQuerySortDetails sortDetails, int totalResultCountMax, String queryExecutionId) Construct all the parameters for executing a named query. Note that the allowable values for the arguments depend on the specific query being executed.- Parameters:
parameterBean
- the values that the query will be based on or null if not relevant to the querypageDetails
- the type of paging to be applied or null for nonesortDetails
- the type of sorting to be applied or null for nonetotalResultCountMax
- greater than zero if the query should not only return the required rows but should also return the total number of possible rows up to the given maximum.queryExecutionId
- ID of a previously-executed query to be used during follow-up page requests - null if not available
-
-
Method Details
-
toString
-
getQueryExecutionId
-
getSortDetails
- Returns:
- the sort details (never null)
-
getPageDetails
- Returns:
- the query paging details (never null)
-
getTotalResultCountMax
public int getTotalResultCountMax()- Returns:
- if > 0 then the query should not only return the required rows but should also return the total count (number of possible rows) up to the given max if 0 then query does not need to return the total count
-
getResultsRequired
public int getResultsRequired()Helper method to get the total number of query results that need to be obtained in order to satisfy thepaging requirements
, the maximum result count ... and an extra to provide 'hasMore' functionality.- Returns:
- the minimum number of results required before pages can be created
-
getParameterBean
- Returns:
- parameterBean the values that the query will be based on or null if not relevant to the query
-