Class PagedQueryTemplate

java.lang.Object
com.emc.documentum.rest.dfc.query.PagedQueryTemplate

public abstract class PagedQueryTemplate extends Object
An abstract paged query template to build DQL for a paginated collection.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    as()
    Declare the AS clause for the query, which will be used in SELECT statement.
    protected abstract List<String>
    Return a list of default fields that will be used, it MUST include those mandatory fields for the object type you are querying
    protected abstract List<SortOrder>
    Declare the default sort specification for this query It will only be used when client do NOT specify a sort specification
    filter(String filterQualification)
    Set the filter expression for the collection results.
    protected abstract String
    Declare the table the DQL is queried against
     
    final String
    Get the count of query results specified by this DQL query.
    final String
    Get the computed DQL query expression.
    static boolean
    Return whether range support is enabled by system.
    protected List<String>
    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 query
    protected abstract String
    Declare the qualification for the query, which will be used in WHERE clause
    protected boolean
     
    Set the attributes for the collection results.
    selectFor(String selectFor)
    Indicate the select for value
    protected 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 false
    thumbnail(boolean thumbnail)
    Indicate whether to retrieve thumbnail for the collection entries, for true, a DQL keyword 'thumbnail_url' should be put into the query

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PagedQueryTemplate

      public PagedQueryTemplate()
  • Method Details

    • page

      public PagedQueryTemplate page(int page, int itemsPerPage)
      Set pagination parameters used in this query
      Parameters:
      page - (page-1)*itemsPerPage+1 will be used as RETURN_RANGE DQL starting index
      itemsPerPage - page*itemsPerPage+1 will be used as RETURN_RANGE DQL ending index
      Returns:
      the template itself
    • order

      public PagedQueryTemplate order(List<SortOrder> sorts)
      Set the order specs for the collection result.
      Parameters:
      sorts - A list of sort specs
      Returns:
      the template itself
    • selectedFields

      public PagedQueryTemplate selectedFields(AttributeView attributeView)
      Set the attributes for the collection results.
      Parameters:
      attributeView - the attribute view
      Returns:
      the template itself
    • filter

      public PagedQueryTemplate filter(String filterQualification)
      Set the filter expression for the collection results.
      Parameters:
      filterQualification - the filter expression
      Returns:
      the template itself
    • fullTextSearch

      public PagedQueryTemplate fullTextSearch(String fullText)
    • thumbnail

      public PagedQueryTemplate thumbnail(boolean 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

      public PagedQueryTemplate selectFor(String 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

      protected abstract List<String> 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

      protected abstract String 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

      protected abstract String from()
      Declare the table the DQL is queried against
      Returns:
      the table name that will be used in FROM clause
    • as

      protected String 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

      protected List<String> hints()
      Return the hints which will used in the query.
      Returns:
      hints
    • defaultSorts

      protected abstract List<SortOrder> 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

      public final String getQuery()
      Get the computed DQL query expression.
      Returns:
      the DQL expression
    • getCountQuery

      public final String getCountQuery()
      Get the count of query results specified by this DQL query.
      Returns:
      the result count
    • hintsRangeConflict

      public boolean hintsRangeConflict()
    • rangeEnabled

      protected boolean rangeEnabled()