com.versionone.apiclient

## Class Query

- java.lang.Object
- - com.versionone.apiclient.Query

-     public class Query
      extends Object

  Represents a VersionOne API Query

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Date` | `MIN_DATE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Query(IAssetType assettype)` Create a query on an Asset Type
    `Query(IAssetType assettype, boolean historical)` Create a historical query on an asset
    `Query(IAssetType assettype, boolean historical, IAttributeDefinition parentrelation)` Create a historical query on an attribute
    `Query(IAssetType assettype, IAttributeDefinition parentrelation)` Create a query on attribute in an Asset
    `Query(Oid oid)` Create a data query from an IOD
    `Query(Oid oid, boolean historical)` Create a Query from an OID

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Date` | `getAsOf()` Get asOf Date
    `IAssetType` | `getAssetType()` get the asset type for the query
    `IFilterTerm` | `getFilter()` Get the filter
    `QueryFind` | `getFind()`
    `Oid` | `getOid()` Get the query oid
    `OrderBy` | `getOrderBy()` Get the OrderBy information
    `Paging` | `getPaging()` Get Paging details
    `protected IAttributeDefinition` | `getParentRelation()` The the AttributeDefinition
    `AttributeSelection` | `getSelection()` Get the attributes used in a 'sel'
    `List<QueryVariable>` | `getVariables()`
    `boolean` | `isHistorical()` Is this a historical query
    `void` | `setAsOf(Date value)` Set asOf Date
    `void` | `setFilter(IFilterTerm value)` Set a filter
    `void` | `setFind(QueryFind value)`
    `void` | `setOrderBy(OrderBy value)` Set OrderBy information
    `void` | `setPaging(Paging value)` Set paging details
    `void` | `setSelection(AttributeSelection value)` Set the attribute selection

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

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

- - ### Field Detail

    - #### MIN_DATE

          public static final Date MIN_DATE

  - ### Constructor Detail

    - #### Query

          public Query(IAssetType assettype)

      Create a query on an Asset Type
      Parameters:
        `assettype` - - type of asset you wish to query

    - #### Query

          public Query(IAssetType assettype,
                       IAttributeDefinition parentrelation)

      Create a query on attribute in an Asset
      Parameters:
        `assettype` - - type of asset to query
        `parentrelation` - - attribute to query

    - #### Query

          public Query(IAssetType assettype,
                       boolean historical)

      Create a historical query on an asset
      Parameters:
        `assettype` - - type of asset to query
        `historical` - - indicate if you want a history query

    - #### Query

          public Query(IAssetType assettype,
                       boolean historical,
                       IAttributeDefinition parentrelation)

      Create a historical query on an attribute
      Parameters:
        `assettype` - - type of asset to query
        `historical` - - indicate if you want a history query
        `parentrelation` - - attribute to query

    - #### Query

          public Query(Oid oid,
                       boolean historical)

      Create a Query from an OID
      Parameters:
        `oid` - - oid to build query
        `historical` - - do you want a historical query

    - #### Query

          public Query(Oid oid)

      Create a data query from an IOD
      Parameters:
        `oid` - - oid to build query

  - ### Method Detail

    - #### isHistorical

          public boolean isHistorical()

      Is this a historical query
      Returns:
        true if this query is historical

    - #### getAssetType

          public IAssetType getAssetType()

      get the asset type for the query
      Returns:
        IAssetType used for query

    - #### getOid

          public Oid getOid()

      Get the query oid
      Returns:
        Object Identifier used in query

    - #### getParentRelation

          protected IAttributeDefinition getParentRelation()

      The the AttributeDefinition
      Returns:
        IAttributedefinition used in query

    - #### getSelection

          public AttributeSelection getSelection()

      Get the attributes used in a 'sel'
      Returns:
        AttributeSelection for this query

    - #### setSelection

          public void setSelection(AttributeSelection value)

      Set the attribute selection
      Parameters:
        `value` - - AttributeSelection

    - #### setFilter

          public void setFilter(IFilterTerm value)

      Set a filter
      Parameters:
        `value` - - IFilterTerm

    - #### getFilter

          public IFilterTerm getFilter()

      Get the filter
      Returns:
        IFilterTerm for this query

    - #### setOrderBy

          public void setOrderBy(OrderBy value)

      Set OrderBy information
      Parameters:
        `value` - - OrderBy

    - #### getOrderBy

          public OrderBy getOrderBy()

      Get the OrderBy information
      Returns:
        OrderBy terms for this query

    - #### setPaging

          public void setPaging(Paging value)

      Set paging details
      Parameters:
        `value` - - Paging

    - #### getPaging

          public Paging getPaging()

      Get Paging details
      Returns:
        Paging for this query

    - #### setAsOf

          public void setAsOf(Date value)

      Set asOf Date
      Parameters:
        `value` - - Date

    - #### getAsOf

          public Date getAsOf()

      Get asOf Date
      Returns:
        AsOf Date for this query

    - #### getFind

          public QueryFind getFind()

      Returns:
        query find parameter

    - #### setFind

          public void setFind(QueryFind value)

      Parameters:
        `value` - query find parameter

    - #### getVariables

          public List<QueryVariable> getVariables()

Copyright © 2020 VersionOne, Inc.. All rights reserved.