Class RelatedQueryParameters

java.lang.Object
com.esri.arcgisruntime.data.RelatedQueryParameters

public final class RelatedQueryParameters extends Object
Parameters to perform a related query on an ArcGISFeatureTable.

When querying related features, all participating tables must be included in the same ArcGISMap or ArcGISScene, as either feature layers or non-spatial tables. The query that uses these parameters will load these related tables.

RelatedQueryParameters lets you specify:

  • Details about the relationship to be queried.
  • A where clause used to filter features from the related table.
  • How to sort the results.
  • Whether to return geometry within the results.

Since:
100.1.0
See Also:
  • Constructor Details

    • RelatedQueryParameters

      public RelatedQueryParameters(RelationshipInfo relationshipInfo)
      Creates related query parameters with the specified relationship information.
      Parameters:
      relationshipInfo - the relationship information between related tables, cannot be null
      Throws:
      IllegalArgumentException - if relationshipInfo is null
      Since:
      100.1.0
  • Method Details

    • getOrderByFields

      public List<QueryParameters.OrderBy> getOrderByFields()
      Gets the collection of order by objects that indicates how to sort the results.

      Results can be sorted by one or more fields. Each order by instance includes a field name and whether to sort by that field in ascending or descending order. If a service-based table is being queried it must support advanced queries.

      Returns:
      the collection of order by objects that indicates how to sort the results
      Since:
      100.1.0
    • setWhereClause

      public void setWhereClause(String whereClause)
      Sets the where clause to apply to the destination table.

      The where clause should follow standard SQL syntax similar to that discussed in the document SQL reference for query expressions used in ArcGIS.

      If the where clause includes dates, they must be correctly formatted based on the geodatabase datasource used in the service. Refer to Dates and time for date formats expected by different data sources.

      ArcGISFeatureTable objects expect that any Field.Type.GLOBALID or Field.Type.GUID parameters in the where clause are formatted as: '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'. All characters are uppercase, wrapped in curly braces and surrounded by single quotes.

      Parameters:
      whereClause - the where clause. May be null or empty.
      Since:
      100.1.0
    • getWhereClause

      public String getWhereClause()
      Gets the where clause; which is a legal SQL statement.

      The where clause should follow standard SQL syntax similar to that discussed in the document SQL reference for query expressions used in ArcGIS.

      If the where clause includes dates, they must be correctly formatted based on the geodatabase datasource used in the service. Refer to Dates and time for date formats expected by different data sources.

      ArcGISFeatureTable objects expect that any Field.Type.GLOBALID or Field.Type.GUID parameters in the where clause are formatted as: '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'. All characters are uppercase, wrapped in curly braces and surrounded by single quotes.

      Returns:
      the where clause
      Since:
      100.1.0
    • getRelationshipInfo

      public RelationshipInfo getRelationshipInfo()
      Gets the relationship information used to define the tables to use for this query.
      Returns:
      the relationship information used to define the tables to use for this query
      Since:
      100.1.0
    • setRelationshipInfo

      public void setRelationshipInfo(RelationshipInfo relationshipInfo)
      Sets the relationship information used to define the tables to use for this query.
      Parameters:
      relationshipInfo - the relationship information used to define the tables to use for this query
      Throws:
      IllegalArgumentException - if relationshipInfo is null
      Since:
      100.1.0
    • setReturnGeometry

      public void setReturnGeometry(boolean returnGeometry)
      True if geometry values are returned in the results, otherwise false.

      This is needed when you want to display the features on a map or a scene. When querying non-spatial data, results do not include geometry.

      Parameters:
      returnGeometry - true if geometry values are returned in the results, otherwise false
      Since:
      100.1.0
    • isReturnGeometry

      public boolean isReturnGeometry()
      True if geometry values are returned in the results, otherwise false.

      This is needed when you want to display the features on a map or a scene. When querying non-spatial data, results do not include geometry.

      Returns:
      true if geometry values are returned in the results, otherwise false
      Since:
      100.1.0
    • setResultOffset

      public void setResultOffset(int resultOffset)
      Sets the starting offset of results to fetch. This is useful for paging through results.

      For consistent ordering of results when using pagination, you should also provide a value for the getOrderByFields(). Note that if you provide a result offset to support paging of results, you must also set a getMaxFeatures() value. Otherwise, the result offset is ignored.

      Parameters:
      resultOffset - the starting offset of results to fetch. This is useful for paging through results.
      Since:
      100.2.1
    • getResultOffset

      public int getResultOffset()
      Gets the starting offset of results to fetch. This is useful for paging through results.

      For consistent ordering of results when using pagination, you should also provide a value for the getOrderByFields(). Note that if you provide a result offset to support paging of results, you must also set a getMaxFeatures() value. Otherwise, the result offset is ignored.

      Returns:
      the starting offset of results to fetch. This is useful for paging through results.
      Since:
      100.2.1
    • setMaxFeatures

      public void setMaxFeatures(int maxFeatures)
      Sets the maximum number of features the query should return.

      For consistent ordering of results when using pagination, provide a value for getOrderByFields(). Note that if you provide a maximum features value to support paging of results, you must also set a QueryParameters.getResultOffset() value. Otherwise, the result may contain local features in place of server features if they satisfy the query. To ensure strict paging of server features, specify both maximum features and getResultOffset().

      Parameters:
      maxFeatures - the maximum number of features the query should return
      Since:
      100.2.1
    • getMaxFeatures

      public int getMaxFeatures()
      Gets the maximum number of features the query should return.

      For consistent ordering of results when using pagination, provide a value for getOrderByFields(). Note that if you provide a maximum features value to support paging of results, you must also set a QueryParameters.getResultOffset() value. Otherwise, the result may contain local features in place of server features if they satisfy the query. To ensure strict paging of server features, specify both maximum features and getResultOffset().

      Returns:
      the maximum number of features the query should return
      Since:
      100.2.1