public class

GeodatabaseFeatureTable

extends FeatureTable
java.lang.Object
   ↳ com.esri.core.table.FeatureTable
     ↳ com.esri.core.geodatabase.GeodatabaseFeatureTable
Known Direct Subclasses

Class Overview

Represents a feature table from a geodatabase.

Obtain a GeodatabaseFeatureTable from a Geodatabase using getGeodatabaseFeatureTableByLayerId(int) or a list of all the GeodatabaseFeatureTables in a geodatabase using getGeodatabaseTables().

In order to be correctly displayed in a FeatureLayer in a map, the spatial reference returned from getSpatialReference() must match the spatial reference of the map to which the FeatureLayer is added. Set the spatial reference when generating the geodatabase using a GeodatabaseSyncTask by calling the setOutSpatialRef(SpatialReference) method.

There are methods in this class for editing features in the table, querying the features, working with feature attachments, as well as for obtaining information about the feature table itself such as its capabilities, fields, and so on.

The geometry of added or updated features must lie within the extent of the table. If using wrap around maps, geometries created from the map should be normalized before being used as feature geometry, by calling normalizeCentralMeridian(Geometry, SpatialReference).

See also:

Summary

Public Methods
Future<Long> addAttachment(long objectId, File file, String contentType, String name, CallbackListener<Long> callback)
Asynchronously adds the specified file as an attachment to the specified feature.
long addAttachment(long objectId, File file, String contentType, String name)
Adds the specified file as an attachment to the specified feature.
long addFeature(Feature feature)
Adds the given feature to the table.
long[] addFeatures(List<Feature> features)
Adds the given features to the table.
boolean canCreate()
Checks to see if new features can be added to this table.
boolean canDelete(long featureId)
Checks to see if the given feature can be deleted.
boolean canDelete()
Checks to see if features in this table can be deleted.
boolean canUpdate()
Checks to see if features in this table can be updated.
boolean canUpdate(long featureId)
Checks to see if the given feature can be updated.
boolean canUpdateGeometry()
Checks to see if features in this table can have their geometry updated.
boolean checkFeatureExists(long id)
Checks the feature with the given ID exists in the table.
void clearEdits()
Reverts any changes (add/update/delete operations) made since the last sync.
GeodatabaseFeature createFeatureWithTemplate(FeatureTemplate template, Geometry geometry)
Creates a geodatabase feature using the given feature template and geometry.
GeodatabaseFeature createFeatureWithType(FeatureType type, Geometry geometry)
Creates a geodatabase feature using the first template of the given FeatureType, and geometry.
GeodatabaseFeature createNewFeature()
Creates a geodatabase feature with null attributes and geometry.
GeodatabaseFeature createNewFeature(Map<String, Object> attributes, Geometry geometry)
Creates a geodatabase feature with the given attributes and geometry.
void deleteAttachment(long featureId, long attachmentId)
Deletes the attachment with the specified ID from the specified feature.
Future<Void> deleteAttachment(long featureId, long attachmentId, CallbackListener<Void> callback)
Asynchronously deletes the attachment with the specified ID from the specified feature.
Future<Void> deleteAttachments(long featureId, long[] attachmentIds, CallbackListener<Void> callback)
Asynchronously deletes the attachments with the specified IDs from the specified feature.
void deleteFeature(long featureId)
Deletes the specified feature from the table.
void deleteFeatures(long[] featureId)
Deletes the specified features from the table.
boolean equals(Object obj)
List<Feature> getAddedFeatures()
Returns a list of all the features that have been added since the last sync.
long getAddedFeaturesCount()
Returns a count for "adds" that occurred on the GeodatabaseFeatureTable since the last upload
String getCapabilities()
Gets the capabilities.
String getCopyright()
Gets the copyright information.
String getDefaultDefinitionExpression()
Returns the definition expression defined at the service level.
List<Feature> getDeletedFeatures()
Returns a list of all the features that have been deleted since the last sync.
long getDeletedFeaturesCount()
Returns a count for "deletes" that occurred on the GeodatabaseFeatureTable since the last upload
String getDescription()
Gets the table description.
String getDisplayField()
Returns the name of the display field.
EditFieldsInfo getEditFieldsInfo()
Returns an object containing information about fields used for editor tracking functionality.
EditInfo getEditInfo(GeodatabaseFeature feature, EditInfo.ACTION_TYPE action)
This method is deprecated. Use canCreate(), canUpdate() and canDelete() instead
List<Field> getEditableAttributeFields()
Gets the attribute fields that should be editable (does not include geometry).
Envelope getExtent()
Returns the extent of the GeodatabaseFeatureTable.
Feature getFeature(long id)
Retrieves the feature with the given ID from the table.
Feature getFeature(long id, SpatialReference outSR)
int getFeatureServiceLayerId()
Returns the layer ID in the feature service that this table was created from.
String getFeatureServiceLayerName()
Returns the name of the layer in the feature service that this table was created from.
List<FeatureTemplate> getFeatureTemplates()
Returns the list of feature templates for this table.
FeatureType getFeatureType(String type)
Returns the FeatureType object corresponding to the given feature type name.
List<FeatureType> getFeatureTypes()
Gets the feature types.
FeatureResult getFeatures(long[] ids)
Retrieves the features with the given IDs from the table.
Field getField(String fieldName)
Returns the Field object with the specified field name.
List<Field> getFields()
Returns all the Fields in the table.
Geodatabase getGeodatabase()
Gets the geodatabase that this feature table comes from.
Geometry.Type getGeometryType()
Gets the geometry type of the table.
String getGlobalIdField()
Returns the field name used for the global ID.
LayerServiceInfo getLayerServiceInfo()
Gets the LayerServiceInfo
long getNumberOfFeatures()
Gets the number of features in the table.
String getObjectIdField()
Returns the field name used for the object ID.
OwnershipBasedAccessControlForFeatures getOwnershipBasedAccessControlForFeatures()
Gets the ownership based access control for features.
List<Relationship> getRelationships()
Gets the relationships.
SpatialReference getSpatialReference()
Returns the spatial reference that the geometries in this table are in.
String getTableName()
This returns the table name as defined by the table type.
String getTypeIdField()
Returns the field name used for the type ID.
List<Feature> getUpdatedFeatures()
Returns a list of all the features that have been updated since the last sync.
long getUpdatedFeaturesCount()
Returns a count for "updates" that occurred on the GeodatabaseFeatureTable since the last upload
boolean hasAttachments()
Returns true if the table supports attachments.
boolean hasGeometry()
This returns true if this feature table has a geometry column.
int hashCode()
boolean isAllowGeometryUpdates()
This method is deprecated. Use canUpdateGeometry()
boolean isEditable()
Checks if the table can be edited.
Future<List<AttachmentInfo>> queryAttachmentInfos(long featureId, CallbackListener<List<AttachmentInfo>> callback)
Query attachment information for the given feature ID.
Future<FeatureResult> queryFeatures(QueryParameters query, CallbackListener<FeatureResult> callback)
Queries the table using the given query parameters, and returns an iterator of features found by the query.
Future<long[]> queryIds(QueryParameters query, CallbackListener<long[]> callback)
Queries the table using the given query parameters, and returns an array of feature IDs found by the query.
Future<Map<Long, FeatureResult>> queryRelated(RelatedQueryParameters relatedQuery, CallbackListener<Map<Long, FeatureResult>> callback)
Performs a query to fetch related records.
Future<InputStream> retrieveAttachment(long featureId, long attachmentId, CallbackListener<InputStream> callback)
Retrieves the attachment with the specified ID from the specified feature.
String toString()
Future<Void> updateAttachment(long featureId, long attachmentId, File file, String contentType, String name, CallbackListener<Void> callback)
Asynchronously updates the specified feature's attachment, specified by its ID.
void updateAttachment(long featureId, long attachmentId, File file, String contentType, String name)
Updates the specified feature's attachment, specified by its ID.
void updateFeature(long featureId, Map<String, Object> attributes)
Updates the specified attributes of the feature with the given ID in the table (leaves the feature geometry untouched).
void updateFeature(long featureId, Geometry geometry)
Updates the geometry of the feature with the given ID in the table (leaves the feature attributes untouched).
void updateFeature(long featureId, Map<String, Object> attributes, Geometry geometry)
Updates the geometry and specified attributes of the feature with the given ID in the table.
void updateFeature(long featureId, Feature feature)
Updates the feature specified by the unique feature ID.
void updateFeatures(long[] featureIds, List<Feature> features)
Updates the features specified by the array of feature IDs passed in.
Protected Methods
void checkOutFields(QueryParameters query)
Checks if output fields have been set and if not sets up the query to return all output fields.
long getHandle()
Gets the handle.
Relationship getRelationship(int relationId)
boolean isAggregateQuery(QueryParameters query)
Returns true if the specified query is an aggregate query, i.e.
List<AttachmentInfo> queryAttachmentInfos(long featureId)
FeatureResult queryFeaturesInner(QueryParameters query)
Queries the table for features synchronously.
Map<Long, FeatureResult> queryRelatedLocal(RelatedQueryParameters relatedQuery)
Synchronously queries related records locally based on the specified RelatedQueryParameters;
ByteArrayInputStream retrieveAttachment(long featureId, long attachmentId)
void testAllowGeometryUpdates()
Throws a table exception if geometry updates are not allowed
[Expand]
Inherited Methods
From class com.esri.core.table.FeatureTable
From class java.lang.Object

Public Methods

public Future<Long> addAttachment (long objectId, File file, String contentType, String name, CallbackListener<Long> callback)

Asynchronously adds the specified file as an attachment to the specified feature.

Parameters
objectId long: the feature ID
file File: the file to add as an attachment; cannot be null.
contentType String: contentType the content type of the file; cannot be null or empty string. This string needs to represent the MIME type of the attachment file.
name String: the name for the attachment. This parameter is used when you do not want to use the original file name. The name must be a file name e.g. text.txt. If name is null the original file name will be used.
callback CallbackListener: will be called when the method completes. Any errors will be reported by onError.
Returns
Future<Long> a Future containing the ID of the attachment, or -1 if the operation has failed
Throws
FileNotFoundException if the file to add is not found
IllegalArgumentException if any input is invalid.

public long addAttachment (long objectId, File file, String contentType, String name)

Adds the specified file as an attachment to the specified feature.

Parameters
objectId long: the feature ID
file File: the file to add as an attachment; cannot be null.
contentType String: the content type of the file; cannot be null or empty string. This string needs to represent the MIME type of the attachment file.
name String: the name for the attachment. This parameter is used when you do not want to use the original file name. The name must be a file name e.g. text.txt. If name is null the original file name will be used.
Returns
long the ID of the attachment, or -1 if the operation has failed
Throws
FileNotFoundException if the file to add is not found
IOException Signals that an I/O exception has occurred.
IllegalArgumentException if any input is invalid.

public long addFeature (Feature feature)

Adds the given feature to the table.

Parameters
feature Feature: the feature to add
Returns
long the unique ID of the added feature
Throws
TableException

public long[] addFeatures (List<Feature> features)

Adds the given features to the table.

Parameters
features List: the features to add
Returns
long[] an array of the unique IDs of the added features
Throws
TableException

public boolean canCreate ()

Checks to see if new features can be added to this table.

Returns
boolean true if this table's associated layer service info indicates that new features can be added to this table

public boolean canDelete (long featureId)

Checks to see if the given feature can be deleted. This method checks the table's associated layer service info to see if feature deletion is allowed. If owner based access control is being used, this method will also take account of the current user. Deletion will be allowed if one of the following is true:

  • allowOthersToDelete is true
  • allowOthersToDelete is false but the current user matches the user who created the feature

    Parameters
    featureId long: ID of feature to check
    Returns
    boolean true if the feature with the given id can be deleted by the current user
  • public boolean canDelete ()

    Checks to see if features in this table can be deleted.

    Returns
    boolean true if this table's associated layer service info indicates that features in this table can be deleted

    public boolean canUpdate ()

    Checks to see if features in this table can be updated.

    Returns
    boolean true if this table's associated layer service info indicates that features in this table can be updated

    public boolean canUpdate (long featureId)

    Checks to see if the given feature can be updated. This method checks the table's associated layer service info to see if feature updates are allowed. If owner based access control is being used, this method will also take account of the current user. Updates will be allowed if one of the following is true:

  • allowOthersToUpdate is true
  • allowOthersToUpdate is false but the current user matches the user who created the feature

    Parameters
    featureId long: ID of feature to check
    Returns
    boolean true if the given feature can be updated by the current user
  • public boolean canUpdateGeometry ()

    Checks to see if features in this table can have their geometry updated.

    Returns
    boolean true if this table's associated layer service info indicates that features in this table can have their geometries updated

    public boolean checkFeatureExists (long id)

    Checks the feature with the given ID exists in the table.

    Parameters
    id long: the feature ID
    Returns
    boolean true if the feature exists, false otherwise

    public void clearEdits ()

    Reverts any changes (add/update/delete operations) made since the last sync.

    public GeodatabaseFeature createFeatureWithTemplate (FeatureTemplate template, Geometry geometry)

    Creates a geodatabase feature using the given feature template and geometry.

    Parameters
    template FeatureTemplate: the non-null feature template
    geometry Geometry: A geometry object.
    Returns
    GeodatabaseFeature the geodatabase feature created
    Throws
    TableException if the feature does not conform to the table's schema

    public GeodatabaseFeature createFeatureWithType (FeatureType type, Geometry geometry)

    Creates a geodatabase feature using the first template of the given FeatureType, and geometry.

    Parameters
    type FeatureType: the non-null feature type
    geometry Geometry: A geometry object
    Returns
    GeodatabaseFeature the geodatabase feature created
    Throws
    TableException if the feature does not conform to the table's schema

    public GeodatabaseFeature createNewFeature ()

    Creates a geodatabase feature with null attributes and geometry.

    Returns
    GeodatabaseFeature the geodatabase feature created
    Throws
    TableException if the feature does not conform to the table's schema

    public GeodatabaseFeature createNewFeature (Map<String, Object> attributes, Geometry geometry)

    Creates a geodatabase feature with the given attributes and geometry.

    Parameters
    attributes Map: the feature's attributes
    geometry Geometry: the feature's geometry
    Returns
    GeodatabaseFeature the geodatabase feature created
    Throws
    TableException if the feature does not conform to the table's schema

    public void deleteAttachment (long featureId, long attachmentId)

    Deletes the attachment with the specified ID from the specified feature.

    Parameters
    featureId long: the feature ID
    attachmentId long: the attachment ID

    public Future<Void> deleteAttachment (long featureId, long attachmentId, CallbackListener<Void> callback)

    Asynchronously deletes the attachment with the specified ID from the specified feature.

    Parameters
    featureId long: the feature ID
    attachmentId long: the attachment ID
    callback CallbackListener: will be called when the method completes.
    Returns
    Future<Void> a Future that can be used to wait for this method to complete.

    public Future<Void> deleteAttachments (long featureId, long[] attachmentIds, CallbackListener<Void> callback)

    Asynchronously deletes the attachments with the specified IDs from the specified feature.

    Parameters
    featureId long: the feature ID
    attachmentIds long: the attachment IDs
    callback CallbackListener: will be called when the method completes.
    Returns
    Future<Void> a Future that can be used to wait for this method to complete.

    public void deleteFeature (long featureId)

    Deletes the specified feature from the table.

    Parameters
    featureId long: the feature's unique ID
    Throws
    TableException

    public void deleteFeatures (long[] featureId)

    Deletes the specified features from the table.

    Parameters
    featureId long: an array of feature IDs to delete
    Throws
    TableException

    public boolean equals (Object obj)

    Parameters
    obj Object
    Returns
    boolean

    public List<Feature> getAddedFeatures ()

    Returns a list of all the features that have been added since the last sync.

    Returns
    List<Feature> the added features

    public long getAddedFeaturesCount ()

    Returns a count for "adds" that occurred on the GeodatabaseFeatureTable since the last upload

    Returns
    long the count of "adds"

    public String getCapabilities ()

    Gets the capabilities.

    Returns
    String the capabilities

    public String getCopyright ()

    Gets the copyright information.

    Returns
    String the copyright

    public String getDefaultDefinitionExpression ()

    Returns the definition expression defined at the service level.

    Returns
    String the default definition expression

    public List<Feature> getDeletedFeatures ()

    Returns a list of all the features that have been deleted since the last sync.

    Returns
    List<Feature> the deleted features

    public long getDeletedFeaturesCount ()

    Returns a count for "deletes" that occurred on the GeodatabaseFeatureTable since the last upload

    Returns
    long the count of "deletes"

    public String getDescription ()

    Gets the table description.

    Returns
    String the description

    public String getDisplayField ()

    Returns the name of the display field.

    Returns
    String the display field name

    public EditFieldsInfo getEditFieldsInfo ()

    Returns an object containing information about fields used for editor tracking functionality.

    Returns
    EditFieldsInfo EditFieldsInfo object, or null

    public EditInfo getEditInfo (GeodatabaseFeature feature, EditInfo.ACTION_TYPE action)

    This method is deprecated.
    Use canCreate(), canUpdate() and canDelete() instead

    Returns the edit info for the given feature and action type.

    Parameters
    feature GeodatabaseFeature: the feature
    action EditInfo.ACTION_TYPE: the action type
    Returns
    EditInfo the edit info, or null

    public List<Field> getEditableAttributeFields ()

    Gets the attribute fields that should be editable (does not include geometry).

    Returns
    List<Field> the editable attribute fields or null if there are none

    public Envelope getExtent ()

    Returns the extent of the GeodatabaseFeatureTable. This is the extent that has been specified with GenerateGeodatabaseParameters when the GeodatabaseFeatureTable was generated.

    Note: Features can only be added to the GeodatabaseFeatureTable if they lie within this extent.

    Returns
    Envelope the extent that was specified when the table was created

    public Feature getFeature (long id)

    Retrieves the feature with the given ID from the table.

    Parameters
    id long: the feature's unique ID
    Returns
    Feature the feature retrieved, or null if the ID was invalid
    Throws
    TableException any error on retrieving the feature

    public Feature getFeature (long id, SpatialReference outSR)

    Parameters
    id long
    outSR SpatialReference
    Returns
    Feature
    Throws
    TableException

    public int getFeatureServiceLayerId ()

    Returns the layer ID in the feature service that this table was created from.

    Returns
    int the associated feature service layer ID

    public String getFeatureServiceLayerName ()

    Returns the name of the layer in the feature service that this table was created from.

    Returns
    String the associated feature service layer name

    public List<FeatureTemplate> getFeatureTemplates ()

    Returns the list of feature templates for this table.

    Returns
    List<FeatureTemplate> the feature templates

    public FeatureType getFeatureType (String type)

    Returns the FeatureType object corresponding to the given feature type name.

    Parameters
    type String: the feature type String
    Returns
    FeatureType the corresponding FeatureType object

    public List<FeatureType> getFeatureTypes ()

    Gets the feature types.

    Returns
    List<FeatureType> the feature types

    public FeatureResult getFeatures (long[] ids)

    Retrieves the features with the given IDs from the table.

    Parameters
    ids long: an array of feature IDs
    Returns
    FeatureResult an iterator for the features obtained from the IDs passed in

    public Field getField (String fieldName)

    Returns the Field object with the specified field name.

    Parameters
    fieldName String: the field name
    Returns
    Field the Field object

    public List<Field> getFields ()

    Returns all the Fields in the table.

    Returns
    List<Field> a list of Fields

    public Geodatabase getGeodatabase ()

    Gets the geodatabase that this feature table comes from.

    Returns
    Geodatabase the geodatabase

    public Geometry.Type getGeometryType ()

    Gets the geometry type of the table.

    Returns
    Geometry.Type the geometry type

    public String getGlobalIdField ()

    Returns the field name used for the global ID.

    Returns
    String the global ID field

    public LayerServiceInfo getLayerServiceInfo ()

    Gets the LayerServiceInfo

    Returns
    LayerServiceInfo LayerServiceInfo

    public long getNumberOfFeatures ()

    Gets the number of features in the table.

    Returns
    long the number of features

    public String getObjectIdField ()

    Returns the field name used for the object ID.

    Returns
    String the object ID field

    public OwnershipBasedAccessControlForFeatures getOwnershipBasedAccessControlForFeatures ()

    Gets the ownership based access control for features.

    Returns
    OwnershipBasedAccessControlForFeatures the ownership based access control for features

    public List<Relationship> getRelationships ()

    Gets the relationships.

    Returns
    List<Relationship> the relationships

    public SpatialReference getSpatialReference ()

    Returns the spatial reference that the geometries in this table are in.

    Returns
    SpatialReference the spatial reference

    public String getTableName ()

    This returns the table name as defined by the table type.

    Returns
    String the table name

    public String getTypeIdField ()

    Returns the field name used for the type ID.

    Returns
    String the type ID field

    public List<Feature> getUpdatedFeatures ()

    Returns a list of all the features that have been updated since the last sync.

    Returns
    List<Feature> the updated features

    public long getUpdatedFeaturesCount ()

    Returns a count for "updates" that occurred on the GeodatabaseFeatureTable since the last upload

    Returns
    long the count of "updates"

    public boolean hasAttachments ()

    Returns true if the table supports attachments.

    Returns
    boolean true if the table supports attachments, false otherwise.

    public boolean hasGeometry ()

    This returns true if this feature table has a geometry column. If it does not, then it is a table only and cannot be bound to a feature layer to draw on a map.

    Returns
    boolean true, if the feature table has a geometry column

    public int hashCode ()

    Returns
    int

    public boolean isAllowGeometryUpdates ()

    This method is deprecated.
    Use canUpdateGeometry()

    Checks if the table allows geometry updates.

    Returns
    boolean true, if geometries can be updated

    public boolean isEditable ()

    Checks if the table can be edited.

    Returns
    boolean true, if the table is editable

    public Future<List<AttachmentInfo>> queryAttachmentInfos (long featureId, CallbackListener<List<AttachmentInfo>> callback)

    Query attachment information for the given feature ID.

    Parameters
    featureId long: the feature id
    callback CallbackListener: the callback
    Returns
    Future<List<AttachmentInfo>> the future

    public Future<FeatureResult> queryFeatures (QueryParameters query, CallbackListener<FeatureResult> callback)

    Queries the table using the given query parameters, and returns an iterator of features found by the query.

    Parameters
    query QueryParameters: the query parameters
    callback CallbackListener: the callback with the iterator of features
    Returns
    Future<FeatureResult> the future with the iterator of features. The elements of the returned FeatureResult can be cast to
    • Feature for queries without statistics, or
    • to Map<String, Object> for queries with statistics.
    Examples:
    (1) Query without out-statistics
     
     QueryParameters query = new QueryParameters();
     query.setOutFields(new String[]{"*"});
     Future resultFuture = gdbFeatureTable.queryFeatures(query, new CallbackListener() {
       
       public void onError(Throwable e) {
         e.printStackTrace();
       }
       
       public void onCallback(FeatureResult featureIterator) {
         ...
       }
     });
     
     for (Object result : resultFuture.get()) {
       Feature feature = (Feature) result;
       // Map attrs = feature.getAttributes();
     }
     
     
    (2) Query with out-statistics
     
     QueryParameters query = new QueryParameters();
     query.setOutStatistics(new OutStatistics[] {
       new OutStatistics(OutStatistics.Type.SUM, "ACRES", "SUM_ACRES")});
    
     Future resultFuture = 
       gdbFeatureTable.queryFeatures(query, new CallbackListener() {
       
       public void onError(Throwable e) {
         e.printStackTrace();
       }
       
       public void onCallback(FeatureResult featureIterator) {
         ...
       }
     });
        
     for (Object result : resultFuture.get()) {
       Map<String, Object> recordAsMap = (Map<String, Object>) result;
       double sumAcres = (Double) (recordAsMap.get("SUM_ACRES"));
     }
     
     

    public Future<long[]> queryIds (QueryParameters query, CallbackListener<long[]> callback)

    Queries the table using the given query parameters, and returns an array of feature IDs found by the query.

    Parameters
    query QueryParameters: the query parameters
    callback CallbackListener: the callback with the array of feature IDs
    Returns
    Future<long[]> the future with the array of feature IDs

    public Future<Map<Long, FeatureResult>> queryRelated (RelatedQueryParameters relatedQuery, CallbackListener<Map<Long, FeatureResult>> callback)

    Performs a query to fetch related records.

    Parameters
    relatedQuery RelatedQueryParameters: query parameters. If the input object id's are not specified, then the result is empty.
    callback CallbackListener: the callback to handle any failure and process result.
    Returns
    Future<Map<Long, FeatureResult>> a map of object id in the source table to features of the related table.
    Example:
     
     // get all buildings in a parcel with area of building < 1000
     RelatedQueryParameters relatedQuery = new RelatedQueryParameters();
     relatedQuery.setObjectIds(new long[] {10}); // parcel id = 10
     relatedQuery.setRelationshipId(0); // relationship id from parcel to building = 0
     relatedQuery.setDefinitionExpression("AREA < 1000");
     
     Future<Map<Long, FeatureResult>> resultFuture = 
       featureTable.queryRelated(relatedQuery, new CallbackListener<Map<Long, FeatureResult>>() {
       
      public void onError(Throwable e) {
        e.printStackTrace();
       }
      
      public void onCallback(Map result) {
        ...
      }
     });
     
     Map<Long, FeatureResult> result = resultFuture.get();
     for (Map.Entry<Long, FeatureResult> entry : result.entrySet()) {
       long id = entry.getKey(); // parcel id
       while (Object o : entry.getValue().get()) {
         Feature feature = (Feature) o; // building
         Map<String, Object> attrs = feature.getAttributes();
       }
     }
     
     

    public Future<InputStream> retrieveAttachment (long featureId, long attachmentId, CallbackListener<InputStream> callback)

    Retrieves the attachment with the specified ID from the specified feature.

    Parameters
    featureId long: the ID of the feature to retrieve the attachment from
    attachmentId long: the ID of the attachment to retrieve
    callback CallbackListener: the callback called when the attachment is retrieved
    Returns
    Future<InputStream> the future can be used to cancel the operation or obtain the result

    public String toString ()

    Returns
    String

    public Future<Void> updateAttachment (long featureId, long attachmentId, File file, String contentType, String name, CallbackListener<Void> callback)

    Asynchronously updates the specified feature's attachment, specified by its ID.

    Parameters
    featureId long: the ID of the feature which has the attachment
    attachmentId long: the ID of the attachment to update
    file File: the file - if null the content will not be changed
    contentType String: the content type - if null the content type will not be changed. It cannot be empty string.
    name String: the name - if null the name will not be changed. It cannot be empty string.
    callback CallbackListener: will be called when the method completes.
    Returns
    Future<Void> a Future that can be used to wait for this method to complete.
    Throws
    IllegalArgumentException if any input is invalid.
    FileNotFoundException
    IOException

    public void updateAttachment (long featureId, long attachmentId, File file, String contentType, String name)

    Updates the specified feature's attachment, specified by its ID.

    Parameters
    featureId long: the ID of the feature which has the attachment
    attachmentId long: the ID of the attachment to update
    file File: the file - if null the content will not be changed
    contentType String: the content type - if null the content type will not be changed. It cannot be empty string.
    name String: the name - if null the name will not be changed. It cannot be empty string.
    Throws
    IllegalArgumentException if any input is invalid.
    FileNotFoundException
    IOException

    public void updateFeature (long featureId, Map<String, Object> attributes)

    Updates the specified attributes of the feature with the given ID in the table (leaves the feature geometry untouched).

    Parameters
    featureId long: the ID of the feature to update
    attributes Map: the attributes to update
    Throws
    TableException the table exception

    public void updateFeature (long featureId, Geometry geometry)

    Updates the geometry of the feature with the given ID in the table (leaves the feature attributes untouched).

    Parameters
    featureId long: the ID of the feature to update
    geometry Geometry: the new geometry
    Throws
    TableException the table exception

    public void updateFeature (long featureId, Map<String, Object> attributes, Geometry geometry)

    Updates the geometry and specified attributes of the feature with the given ID in the table.

    Parameters
    featureId long: the ID of the feature to update
    attributes Map: the attributes to update
    geometry Geometry: the new geometry
    Throws
    TableException the table exception

    public void updateFeature (long featureId, Feature feature)

    Updates the feature specified by the unique feature ID. To use this method, create a new feature with the properties you wish to update (such as geometry, certain attribute values), and pass in this feature.

    Parameters
    featureId long: the ID of the feature to update
    feature Feature: the feature with the updated properties
    Throws
    TableException

    public void updateFeatures (long[] featureIds, List<Feature> features)

    Updates the features specified by the array of feature IDs passed in. To use this method, for each feature you wish to update, create a new feature with the properties to update (such as geometry, certain attribute values), and add it to the list of features in the same order as in the array of IDs.

    Parameters
    featureIds long: the IDs of features to update
    features List: the features with the updated properties
    Throws
    TableException

    Protected Methods

    protected void checkOutFields (QueryParameters query)

    Checks if output fields have been set and if not sets up the query to return all output fields. Additionally ensures that the object id field is contained in the output fields.

    protected long getHandle ()

    Gets the handle.

    Returns
    long the handle

    protected Relationship getRelationship (int relationId)

    Parameters
    relationId int
    Returns
    Relationship

    protected boolean isAggregateQuery (QueryParameters query)

    Returns true if the specified query is an aggregate query, i.e. out statistics are set.

    Parameters
    query QueryParameters
    Returns
    boolean

    protected List<AttachmentInfo> queryAttachmentInfos (long featureId)

    Parameters
    featureId long
    Returns
    List<AttachmentInfo>
    Throws
    JsonParseException
    IOException
    Exception

    protected FeatureResult queryFeaturesInner (QueryParameters query)

    Queries the table for features synchronously. Distinguishes between feature queries and aggregate queries.

    Parameters
    query QueryParameters
    Returns
    FeatureResult
    Throws
    Exception

    protected Map<Long, FeatureResult> queryRelatedLocal (RelatedQueryParameters relatedQuery)

    Synchronously queries related records locally based on the specified RelatedQueryParameters;

    Parameters
    relatedQuery RelatedQueryParameters
    Returns
    Map<Long, FeatureResult>

    protected ByteArrayInputStream retrieveAttachment (long featureId, long attachmentId)

    Parameters
    featureId long
    attachmentId long
    Returns
    ByteArrayInputStream

    protected void testAllowGeometryUpdates ()

    Throws a table exception if geometry updates are not allowed

    Throws
    TableException