Package com.emc.documentum.rest.dfc.query

# Class DQLBuilder

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

public class DQLBuilder extends Object
Utility to build DQL

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DQLBuilder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `build()`
  Get the final DQL statement
  `DQLBuilder`
  `from(String table)`
  Build `FROM` statement
  `DQLBuilder`
  `hint(String hint)`
  Add the hint to the dql
  `DQLBuilder`
  `hints(List<String> hints)`
  Add the hint list to the dql
  `DQLBuilder`
  `order(List<SortOrder> sorts)`
  Build `ORDER BY` statement
  `DQLBuilder`
  `returnRange(int start, int end, List<SortOrder> sorts)`
  Build `RETURN_RANGE` statement
  `DQLBuilder`
  `search(String search)`
  Build `SEARCH DOCUMENT CONTAINS` statement
  `DQLBuilder`
  `select(String... attributes)`
  Build `SELECT` statement with attributes
  `DQLBuilder`
  `select(List<String> attributes)`
  Build `SELECT` statement with attributes
  `DQLBuilder`
  `select(List<String> attributes, String asClause)`
  Build `SELECT` statement with attributes and `AS` clause
  `DQLBuilder`
  `selectFor(String selectFor)`
  Set select for value
  `DQLBuilder`
  `where(String condition)`
  Build `WHERE` statement
  `DQLBuilder`
  `where(String condition, Object... args)`
  Build `WHERE` statement

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DQLBuilder

    public DQLBuilder()

- ## Method Details

  - ### select

    public DQLBuilder select(String... attributes)
    Build `SELECT` statement with attributes
    Parameters:
      `attributes` - attributes to select
    Returns:
      DQL with `SELECT` statement

  - ### select

    public DQLBuilder select(List<String> attributes)
    Build `SELECT` statement with attributes
    Parameters:
      `attributes` - attributes to select
    Returns:
      DQL with `SELECT` statement

  - ### select

    public DQLBuilder select(List<String> attributes, String asClause)
    Build `SELECT` statement with attributes and `AS` clause
    Parameters:
      `attributes` - attributes to select
      `asClause` - as clause
    Returns:
      DQL with `SELECT` statement and `AS` clause

  - ### selectFor

    public DQLBuilder selectFor(String selectFor)
    Set select for value
    Parameters:
      `selectFor` - for which the select is executed
    Returns:
      this DQLBuilder object

  - ### from

    public DQLBuilder from(String table)
    Build `FROM` statement
    Parameters:
      `table` - the source table to query
    Returns:
      DQL with `FROM` statement

  - ### search

    public DQLBuilder search(String search)
    Build `SEARCH DOCUMENT CONTAINS` statement
    Parameters:
      `search` - simple search expression
    Returns:
      DQL with `SEARCH DOCUMENT CONTAINS` statement

  - ### where

    public DQLBuilder where(String condition)
    Build `WHERE` statement
    Parameters:
      `condition` - `WHERE` condition
    Returns:
      DQL with `WHERE` statement

  - ### where

    public DQLBuilder where(String condition, Object... args)
    Build `WHERE` statement
    Parameters:
      `condition` - `WHERE` condition
      `args` - arguments in `WHERE` statement
    Returns:
      DQL with `WHERE` statement

  - ### order

    public DQLBuilder order(List<SortOrder> sorts)
    Build `ORDER BY` statement
    Parameters:
      `sorts` - instances of `SortOrder` representing the sort strategies
    Returns:
      DQL with `ORDER BY` statement

  - ### returnRange

    public DQLBuilder returnRange(int start, int end, List<SortOrder> sorts)
    Build `RETURN_RANGE` statement
    Parameters:
      `start` - range start
      `end` - range end
      `sorts` - instances of `SortOrder` representing the sort strategies
    Returns:
      DQL with `RETURN_RANGE` statement and OPTIMIZE_TOP N

  - ### hint

    public DQLBuilder hint(String hint)
    Add the hint to the dql
    Parameters:
      `hint` - the hint to be added
    Returns:
      the dql builder

  - ### hints

    public DQLBuilder hints(List<String> hints)
    Add the hint list to the dql
    Parameters:
      `hints` - the hint list
    Returns:
      the dql builder

  - ### build

    public String build()
    Get the final DQL statement
    Returns:
      complete DQL statement