Service Geodatabase
A container for a collection of ServiceFeatureTable connected to a feature service. A ServiceGeodatabase connects to a feature service as a whole, grouping together ServiceFeatureTable instances for related records queries, connecting to a version in a branch-versioned service, and managing edits for all tables.
This grouping is exposed through ServiceGeodatabase.connectedTables. The collection includes tables that are loaded from the same web map and feature service, or created by calling ServiceGeodatabase.getTable. Tables created directly with ServiceFeatureTable constructors are standalone and are not grouped with a ServiceGeodatabase.
When a ServiceGeodatabase is created from a portal item or URL, ServiceGeodatabase.connectedTables is initially empty. To populate it, use ServiceGeodatabase.serviceInfo with ArcGISFeatureServiceInfo.layerInfos or ArcGISFeatureServiceInfo.tableInfos, and call ServiceGeodatabase.getTable.
Since
200.1.0
Constructors
Creates a new ServiceGeodatabase from a feature service portal item, and connects to a specific version in the feature service. If a version with the name does not exist, or the service is not branch versioned, the ServiceGeodatabase will fail to load.
Creates a new ServiceGeodatabase connected to a specific version in a feature service. If a version with the name does not exist, or the service is not branch versioned, the ServiceGeodatabase will fail to load.
Properties
The collection of feature tables managed by the ServiceGeodatabase. This collection is populated when tables are loaded from the same web map and feature service or when ServiceGeodatabase.getTable is called.
The name of the default version.
The PortalItem which the ServiceGeodatabase was created from.
The metadata of the service this object is connected to.
The type of read and edit sessions to use when working with the service. The default value is FeatureServiceSessionType.Transient.
Whether the service supports branch versioning.
The URL of the feature service or the portal item to connect to. Use ArcGISFeatureServiceInfo.url to get the feature service URL.
The name of the version the ServiceGeodatabase is currently connected to. To change the version this ServiceGeodatabase is connected to, use the ServiceGeodatabase.switchVersion method.
Functions
Applies all local edits in all tables to the service. This method applies all feature table edits to the feature service as a single transaction. If one of the edits fails, all edits are rolled-back, and geodatabase integrity is preserved. This is the recommended approach to applying edits and is typically more efficient than calling ServiceFeatureTable.applyEdits on each table.
Creates a new version in the service based on the default version. Branch versioning requires that the default version always be the ancestor of all other versions.
Gets a list of all versions on the service. If the service isn't branch versioned, an ErrorType.MappingBranchVersioningNotSupportedByService is thrown.
Returns a service feature table object from the ID of a layer or table in the service. If a table instance for the layer already exists in ServiceGeodatabase.connectedTables, the existing object will be returned. Otherwise, a new ServiceFeatureTable will be created.
Determines if any of the tables in the ServiceGeodatabase have unapplied edits.
Switches all connected feature tables to the new version. An error is thrown if:
Undos all of the local edits in all the tables.
Inherited functions
Adds a set of features created from a shared template to the database. This method adds features into their respective layer or table in the database, along with their related records and utility associations, all within a single transaction.
Cancels loading metadata for the Loadable object.
Creates a set of features based on the specified shared template and geometry. The specified SharedTemplate determines the primary feature and its related set of features joined by:
Queries the database for shared templates. Returns a SharedTemplate collection that matches the SharedTemplateQueryParameters for every ArcGISFeatureTable.serviceLayerId.