com.esri.adf.web.data.query
Class RelateCriteria

java.lang.Object
  extended by com.esri.adf.web.data.query.RelateCriteria
All Implemented Interfaces:
QueryCriteria, Serializable

public class RelateCriteria
extends Object
implements QueryCriteria, Serializable

A source table or layer may participate in one or more relationships with one or more target tables or layers. Each relationship is identified by a unique ID.

RelateCriteria is in queries to fetch related records. When using RelateCriteria with WebQuery, pass in a single WebLayerInfo of the source table/layer whose related records you want to fetch.

 WebQuery query = ...;
 
 WebLayerInfo sourceLayerInfo = ...; //The source table or layer
 List<WebLayerInfo> newInfo = new ArrayList<WebLayerInfo>(1);
 newInfo.add(sourceLayerInfo);
 
 RelateCriteria criteria = new RelateCriteria();
 criteria.setSourceOIDs(new int[]{0,1,2}); //The IDs of features whose related records need to be fetched
 criteria.setRelationshipId(3); //The relationship that the source and target participate in
 query.query(criteria, newInfo);
 

See Also:
Serialized Form

Field Summary
static String CRITERIA_TYPE
          Criteria Type: "Relate"
 
Constructor Summary
RelateCriteria()
           
 
Method Summary
 String getCriteriaType()
          A String representing the query type e.g.
 String getDisplayFieldName()
          Gets the field name which can be used in the query result as a result node title.
 List<? extends LayerDefinition> getLayerDefinitions()
          Returns the list of LayerDefinition objects that will be used to customize how the related records are displayed.
 int getMaxRecordCount()
          Gets the maximum number of returning records in one query.
 int getRelationshipId()
          Returns the ID of the relationship that the source & target tables/layers participate in.
 int[] getSourceOIDs()
          Returns the ID of the features whose related records need to be fetched.
 boolean isFetchResultDetails()
          Returns true if all the feature details e.g.
 void setDisplayFieldName(String displayFieldName)
          Sets the field name which can be used in the query result as a result node title.
 void setFetchResultDetails(boolean fetchResultDetails)
          Sets to true to return all the feature details e.g.
 void setLayerDefinitions(List<? extends LayerDefinition> layerDefinitions)
          Sets the LayerDefinition objects that will be used to customize how the related records are displayed.
 void setMaxRecordCount(int maxRecordCount)
          Sets the maximum number of returning records in one query.
 void setRelationshipId(int relationshipId)
          Sets the ID of the relationship that the source & target tables/layers participate in.
 void setSourceOIDs(int[] ids)
          Sets the ID of the features whose related records need to be fetched.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CRITERIA_TYPE

public static final String CRITERIA_TYPE
Criteria Type: "Relate"

See Also:
Constant Field Values
Constructor Detail

RelateCriteria

public RelateCriteria()
Method Detail

getCriteriaType

public String getCriteriaType()
Description copied from interface: QueryCriteria
A String representing the query type e.g. "Identify"

Specified by:
getCriteriaType in interface QueryCriteria

getDisplayFieldName

public String getDisplayFieldName()
Description copied from interface: QueryCriteria
Gets the field name which can be used in the query result as a result node title.

Specified by:
getDisplayFieldName in interface QueryCriteria
Returns:
the field name.

setDisplayFieldName

public void setDisplayFieldName(String displayFieldName)
Description copied from interface: QueryCriteria
Sets the field name which can be used in the query result as a result node title.

Specified by:
setDisplayFieldName in interface QueryCriteria

isFetchResultDetails

public boolean isFetchResultDetails()
Description copied from interface: QueryCriteria
Returns true if all the feature details e.g. fields should be returned.

Specified by:
isFetchResultDetails in interface QueryCriteria

setFetchResultDetails

public void setFetchResultDetails(boolean fetchResultDetails)
Description copied from interface: QueryCriteria
Sets to true to return all the feature details e.g. fields.

Specified by:
setFetchResultDetails in interface QueryCriteria

getMaxRecordCount

public int getMaxRecordCount()
Description copied from interface: QueryCriteria
Gets the maximum number of returning records in one query.

Specified by:
getMaxRecordCount in interface QueryCriteria
Returns:
the maximum number of returning records.

setMaxRecordCount

public void setMaxRecordCount(int maxRecordCount)
Description copied from interface: QueryCriteria
Sets the maximum number of returning records in one query.

Specified by:
setMaxRecordCount in interface QueryCriteria
Parameters:
maxRecordCount - the new value.

getSourceOIDs

public int[] getSourceOIDs()
Returns the ID of the features whose related records need to be fetched. These features belong to the source table/layer in the relationship.


setSourceOIDs

public void setSourceOIDs(int[] ids)
Sets the ID of the features whose related records need to be fetched. These features belong to the source table/layer in the relationship.


setRelationshipId

public void setRelationshipId(int relationshipId)
Sets the ID of the relationship that the source & target tables/layers participate in. The related records will be fetched from the target table/layer.


getRelationshipId

public int getRelationshipId()
Returns the ID of the relationship that the source & target tables/layers participate in. The related records will be fetched from the target table/layer.


setLayerDefinitions

public void setLayerDefinitions(List<? extends LayerDefinition> layerDefinitions)
Sets the LayerDefinition objects that will be used to customize how the related records are displayed. The LayerDefinition should be based on the target table/layer in the relationship.

Parameters:
layerDefinitions - the list of layer definition objects

getLayerDefinitions

public List<? extends LayerDefinition> getLayerDefinitions()
Returns the list of LayerDefinition objects that will be used to customize how the related records are displayed.

Returns:
the list of layer definition objects