public class

RelatedQueryParameters

extends Object
java.lang.Object
   ↳ com.esri.core.tasks.query.RelatedQueryParameters

Class Overview

This class is used to set up the parameters for a 'query related records' operation on a layer/table supporting this operation. These parameters can be used against local or server data.

A QueryTask instance or GeodatabaseFeatureServiceTable.queryRelated() can then be used to execute a related records query against a service or the GeodatabaseFeatureTable.queryRelated() method can be used against a local geodatabase.

At the minimum to execute a related records query you must create an instance of this class and populate it with:

  • the relationship ID
  • the set of fields to return in the results
  • the object IDs for which to search related records.
Additional parameters can be set using the remaining setter methods of this class, such as a definition expression for the query, whether geometries are to be returned in the result FeatureResult, whether Z and/or M values should be returned, and so on.

Note that relationship IDs that a given layer/table participates in are included in the layer/table response.

Summary

Fields
protected QueryRelatedRecordsParametersInternal _params
Public Constructors
RelatedQueryParameters()
Instantiates a new related query parameters instance.
Public Methods
String getDefintionExpression()
Gets the definition expression.
String getGeodatabaseVersion()
Gets the geodatabase version, if any, to use for the data to query.
double getMaxAllowableOffset()
Returns the maximum allowable offset.
long[] getObjectIds()
Gets the object IDs.
String[] getOutFields()
Returns the array of fields to be included in the returned result set.
SpatialReference getOutSpatialReference()
Returns the spatial reference of any returned geometries.
int getRelationshipId()
Gets the relationship ID to be queried.
boolean isReturnGeometry()
Returns true if the result set is to include the geometry associated with each result.
boolean isReturnM()
Checks whether M values are returned in any result geometries.
boolean isReturnZ()
Checks whether Z values are returned in any result geometries.
void setDefinitionExpression(String defintionExpression)
Sets the definition expression to be applied to the related table/layer.
void setGeodatabaseVersion(String geodatabaseVersion)
Sets the geodatabase version to use for the data to query.
void setMaxAllowableOffset(double offset)
Sets the maximum allowable offset which is used for generalizing geometries returned by the query operation.
void setObjectIds(long[] objectIds)
Sets the object IDs of this layer/table to be queried.
void setOutFields(String[] outFields)
Sets the array of fields to be included in the returned result set.
void setOutSpatialReference(SpatialReference outSR)
Sets the spatial reference of any returned geometries.
void setRelationshipId(int id)
Sets the ID of the relationship to be queried.
void setReturnGeometry(boolean returnGeometry)
Sets whether the result set should include the geometry associated with each result.
void setReturnM(boolean returnM)
Sets whether M values are returned in any result geometries.
void setReturnZ(boolean returnZ)
Sets whether Z values are returned in any result geometries.
String toJSON()
Returns JSON representing this object.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected QueryRelatedRecordsParametersInternal _params

Public Constructors

public RelatedQueryParameters ()

Instantiates a new related query parameters instance.

Public Methods

public String getDefintionExpression ()

Gets the definition expression.

Returns
String the definition expression

public String getGeodatabaseVersion ()

Gets the geodatabase version, if any, to use for the data to query.

Returns
String the geodatabase version

public double getMaxAllowableOffset ()

Returns the maximum allowable offset.

Returns
double the maximum allowable offset value

public long[] getObjectIds ()

Gets the object IDs.

Returns
long[] the object IDs

public String[] getOutFields ()

Returns the array of fields to be included in the returned result set.

Returns
String[] an array of field names

public SpatialReference getOutSpatialReference ()

Returns the spatial reference of any returned geometries.

Returns
SpatialReference the spatial reference of any returned geometries.

public int getRelationshipId ()

Gets the relationship ID to be queried.

Returns
int the relationship ID

public boolean isReturnGeometry ()

Returns true if the result set is to include the geometry associated with each result. The default is true.

Returns
boolean true if the result set is to include the geometry associated with each result, false otherwise

public boolean isReturnM ()

Checks whether M values are returned in any result geometries. The default is false.

Returns
boolean true, if M values are included in result geometries.

public boolean isReturnZ ()

Checks whether Z values are returned in any result geometries. The default is false. This parameter has no effect on a local geodatabase.

Returns
boolean true, if Z values are included in result geometries.

public void setDefinitionExpression (String defintionExpression)

Sets the definition expression to be applied to the related table/layer. From the list of records that are related to the specified object IDs, only those records that conform to this expression will be returned.

Parameters
defintionExpression String: the definition expression

public void setGeodatabaseVersion (String geodatabaseVersion)

Sets the geodatabase version to use for the data to query. Only has an effect if the data is versioned. This parameter has no effect on a local geodatabase.

Parameters
geodatabaseVersion String: the version to set.

public void setMaxAllowableOffset (double offset)

Sets the maximum allowable offset which is used for generalizing geometries returned by the query operation. This parameter has no effect on a local geodatabase.

Parameters
offset double: the maximum allowable offset value

public void setObjectIds (long[] objectIds)

Sets the object IDs of this layer/table to be queried. Records related to these object IDs will be queried.

Parameters
objectIds long: the object IDs in a long array

public void setOutFields (String[] outFields)

Sets the array of fields to be included in the returned result set. For the query results to include all the field values, specify the wildcard '*' character as the value of this parameter. This parameter has no effect on a local geodatabase.

Parameters
outFields String: an array of field names

public void setOutSpatialReference (SpatialReference outSR)

Sets the spatial reference of any returned geometries.

Parameters
outSR SpatialReference: the spatial reference of any returned geometries.

public void setRelationshipId (int id)

Sets the ID of the relationship to be queried. The relationships that this layer/table participates in are included in the layer/table response. Records in tables/layers corresponding to the related table/layer of the relationship are queried. This is a required parameter.

Parameters
id int: the relationship ID to be queried

public void setReturnGeometry (boolean returnGeometry)

Sets whether the result set should include the geometry associated with each result. The default is true. This parameter has no effect on a local geodatabase.

Parameters
returnGeometry boolean: true for the result set to include the geometry associated with each result

public void setReturnM (boolean returnM)

Sets whether M values are returned in any result geometries. The default is false. This parameter has no effect on a local geodatabase.

Parameters
returnM boolean: true to have M values returned.

public void setReturnZ (boolean returnZ)

Sets whether Z values are returned in any result geometries. The default is false.

Parameters
returnZ boolean: true to have Z values returned.

public String toJSON ()

Returns JSON representing this object.

Returns
String JSON string