Class PagedQueryTemplate
java.lang.Object
com.emc.documentum.rest.dfc.query.PagedQueryTemplate
An abstract paged query template to build DQL for a paginated collection.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
as()
Declare the AS clause for the query, which will be used in SELECT statement.Return a list of default fields that will be used, it MUST include those mandatory fields for the object type you are queryingDeclare the default sort specification for this query It will only be used when client do NOT specify a sort specificationSet the filter expression for the collection results.protected abstract String
from()
Declare the table the DQL is queried againstfullTextSearch
(String fullText) final String
Get the count of query results specified by this DQL query.final String
getQuery()
Get the computed DQL query expression.static boolean
Return whether range support is enabled by system.hints()
Return the hints which will used in the query.boolean
boolean
Return whether thumbnail link should be retrieved.Set the order specs for the collection result.page
(int page, int itemsPerPage) Set pagination parameters used in this queryprotected abstract String
Declare the qualification for the query, which will be used in WHERE clauseprotected boolean
selectedFields
(AttributeView attributeView) Set the attributes for the collection results.Indicate the select for valueprotected abstract boolean
Tell whether the type to be queried support repeating attribute(s) in fields of select clause; the template uses the result of this call to sort out the right sequence of repeating attributes in the query result (CS-40535) if the type has repeating attributes in default query fields, this method MUST return true ; the query template will append 'i_position' to the fields of select clause if the type doesn't have repeating attributes in default query fields, but allow specifying repeating attributes in its filter, this method SHOULD return true; the query template will append 'i_position' to the fields of select clause if the type doesn't have repeating attributes in its type definition, this method MUST return falsethumbnail
(boolean thumbnail) Indicate whether to retrieve thumbnail for the collection entries, for true, a DQL keyword 'thumbnail_url' should be put into the query
-
Constructor Details
-
PagedQueryTemplate
public PagedQueryTemplate()
-
-
Method Details
-
page
Set pagination parameters used in this query- Parameters:
page
- (page-1)*itemsPerPage+1 will be used as RETURN_RANGE DQL starting indexitemsPerPage
- page*itemsPerPage+1 will be used as RETURN_RANGE DQL ending index- Returns:
- the template itself
-
order
Set the order specs for the collection result.- Parameters:
sorts
- A list of sort specs- Returns:
- the template itself
-
selectedFields
Set the attributes for the collection results.- Parameters:
attributeView
- the attribute view- Returns:
- the template itself
-
filter
Set the filter expression for the collection results.- Parameters:
filterQualification
- the filter expression- Returns:
- the template itself
-
fullTextSearch
-
thumbnail
Indicate whether to retrieve thumbnail for the collection entries, for true, a DQL keyword 'thumbnail_url' should be put into the query- Parameters:
thumbnail
-true
to retrieve thumbnail links- Returns:
- the template itself
-
isReturnThumbnail
public boolean isReturnThumbnail()Return whether thumbnail link should be retrieved.- Returns:
true
to retrieve thumbnail links
-
selectFor
Indicate the select for value- Parameters:
selectFor
- the value for select- Returns:
- the template itself
-
hasRangeSupport
public static boolean hasRangeSupport()Return whether range support is enabled by system.- Returns:
true
if range is supported.
-
defaultFields
Return a list of default fields that will be used, it MUST include those mandatory fields for the object type you are querying- Returns:
- a list of fields (typically object attributes) that will be used in the SELECT clause
-
qualification
Declare the qualification for the query, which will be used in WHERE clause- Returns:
- a qualification string that can be used in WHERE clause
-
from
Declare the table the DQL is queried against- Returns:
- the table name that will be used in FROM clause
-
as
Declare the AS clause for the query, which will be used in SELECT statement. By default it is empty as this is not frequently used.- Returns:
- the AS clause
-
hints
Return the hints which will used in the query.- Returns:
- hints
-
defaultSorts
Declare the default sort specification for this query It will only be used when client do NOT specify a sort specification- Returns:
- a list of SortDefinition that defines the default sorting order
-
supportRepeatingAttributeQuery
protected abstract boolean supportRepeatingAttributeQuery()Tell whether the type to be queried support repeating attribute(s) in fields of select clause; the template uses the result of this call to sort out the right sequence of repeating attributes in the query result (CS-40535) if the type has repeating attributes in default query fields, this method MUST return true ; the query template will append 'i_position' to the fields of select clause if the type doesn't have repeating attributes in default query fields, but allow specifying repeating attributes in its filter, this method SHOULD return true; the query template will append 'i_position' to the fields of select clause if the type doesn't have repeating attributes in its type definition, this method MUST return false- Returns:
- a boolean value indicating whether the type has support for repeating attribute query
-
getQuery
Get the computed DQL query expression.- Returns:
- the DQL expression
-
getCountQuery
Get the count of query results specified by this DQL query.- Returns:
- the result count
-
hintsRangeConflict
public boolean hintsRangeConflict() -
rangeEnabled
protected boolean rangeEnabled()
-