Package org.alfresco.query
Class CannedQueryParameters
- java.lang.Object
-
- org.alfresco.query.CannedQueryParameters
-
public class CannedQueryParameters extends java.lang.Object
Parameters defining thenamed 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 Modifier and Type Field Description static int
DEFAULT_TOTAL_COUNT_MAX
-
Constructor Summary
Constructors Constructor Description CannedQueryParameters(java.lang.Object parameterBean)
pageDetails: null sortDetails: null totalResultCountMax: 0 queryExecutionId: nullCannedQueryParameters(java.lang.Object parameterBean, int skipResults, int pageSize, java.lang.String queryExecutionId)
Defaults: pageDetails.pageNumber: 1 pageDetails.pageCount: 1 totalResultCountMax: 0CannedQueryParameters(java.lang.Object parameterBean, CannedQueryPageDetails pageDetails, CannedQuerySortDetails sortDetails)
Defaults: totalResultCountMax: 0 queryExecutionId: nullCannedQueryParameters(java.lang.Object parameterBean, CannedQueryPageDetails pageDetails, CannedQuerySortDetails sortDetails, int totalResultCountMax, java.lang.String queryExecutionId)
Construct all the parameters for executing a named query.CannedQueryParameters(java.lang.Object parameterBean, CannedQuerySortDetails sortDetails, PagingRequest pagingRequest)
Construct all the parameters for executing a named query, using values from thePagingRequest
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CannedQueryPageDetails
getPageDetails()
java.lang.Object
getParameterBean()
java.lang.String
getQueryExecutionId()
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 ...CannedQuerySortDetails
getSortDetails()
int
getTotalResultCountMax()
java.lang.String
toString()
-
-
-
Field Detail
-
DEFAULT_TOTAL_COUNT_MAX
public static final int DEFAULT_TOTAL_COUNT_MAX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CannedQueryParameters
public CannedQueryParameters(java.lang.Object parameterBean)
- pageDetails: null
- sortDetails: null
- totalResultCountMax: 0
- queryExecutionId: null
-
CannedQueryParameters
public CannedQueryParameters(java.lang.Object parameterBean, int skipResults, int pageSize, java.lang.String queryExecutionId)
Defaults:- pageDetails.pageNumber: 1
- pageDetails.pageCount: 1
- totalResultCountMax: 0
-
CannedQueryParameters
public CannedQueryParameters(java.lang.Object parameterBean, CannedQueryPageDetails pageDetails, CannedQuerySortDetails sortDetails)
Defaults:- totalResultCountMax: 0
- queryExecutionId: null
-
CannedQueryParameters
public CannedQueryParameters(java.lang.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(java.lang.Object parameterBean, CannedQueryPageDetails pageDetails, CannedQuerySortDetails sortDetails, int totalResultCountMax, java.lang.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 Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getQueryExecutionId
public java.lang.String getQueryExecutionId()
-
getSortDetails
public CannedQuerySortDetails getSortDetails()
- Returns:
- the sort details (never null)
-
getPageDetails
public CannedQueryPageDetails 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
public java.lang.Object getParameterBean()
- Returns:
- parameterBean the values that the query will be based on or null if not relevant to the query
-
-