IClassSchemaEdit Interface

Provides access to member to modify an object class schema.

When To Use

Use the IClassSchemaEdit interface when you want to modify the class properties of an object class, such as the class extension, model name, etc. You can also use this interface to register a table or feature class with the Geodatabase to make it a true object class.

Members

Name Description
Method AlterAliasName The alias name of the object class.
Method AlterClassExtensionCLSID Changes the class extension COM class associated with this database class.
Method AlterDefaultValue The default value of the object class field.
Method AlterDomain The default domain of the object class field.
Method AlterFieldAliasName The alias name of the object class field.
Method AlterFieldModelName The model name of the object class field.
Method AlterInstanceCLSID Changes the instance COM class associated with this database class.
Method AlterModelName The model name of the object class.
Method RegisterAsObjectClass Registers this class with the database, assigning it a class id and creating an object id column.

IClassSchemaEdit.AlterAliasName Method

The alias name of the object class.

Public Sub AlterAliasName ( _
    ByVal Name As String _
)
public void AlterAliasName (
    string Name
);

Description

Alters the alias name for the object class.

Remarks

Object classes in a Geodatabase can have between one and three names. The name of the object class, which is the same as the name of the table in the DBMS in which the objects in the object class are stored, the alias name which the user can set for display purposes in end user applications. The third name is the model name which is a tool for developers of custom objects to use to guarantee the names of objects independent of the true name or alias name.

The AlterAliasNamemethod sets the alias name for the object class. The alias name can be returned using the IObjectClassinterface.

IClassSchemaEdit.AlterClassExtensionCLSID Method

Changes the class extension COM class associated with this database class.

Public Sub AlterClassExtensionCLSID ( _
    ByVal ClassExtensionCLSID As UID, _
    ByVal classExtensionProperties As IPropertySet _
)
public void AlterClassExtensionCLSID (
    UID ClassExtensionCLSID,
    IPropertySet classExtensionProperties
);

Description

The AlterClassExtensionCLSIDmethod is used to change the class extension for an object class in the Geodatabase. For example, you may have a class to which you want to associate a class extension that you have developed. You use the **AlterClassExtensionCLSID**to do so.

Remarks

**AlterClassExtensionCLSID**will try to instantiate the object for the class extension that you provide. If it fails to instantiate it, the method will fail. Therefore, you must have the DLL which has the implementation of your class extension registered on your system before you call **AlterClassExtensionCLSID**.

Before you QI for **AlterClassExtensionCLSID**, you will have had to open the object class. So, if this fails because you no longer have the DLL registered on your system for a class extension that is already associated with the class, then you must use the IFeatureWorkspaceSchemaEditinterface to alter the class extension CLSID.

IClassSchemaEdit.AlterDefaultValue Method

The default value of the object class field.

Public Sub AlterDefaultValue ( _
    ByVal FieldName As String, _
    ByVal Value As Object _
)
public void AlterDefaultValue (
    string FieldName,
    object Value
);

Remarks

You can assign a default value to a field in an object class at either the class level, or the subtype level. The AlterDefaultValuemethod on IClassSchemaEditallows you to set a default value for a field at the class level.

**AlterDefaultValue**takes as arguments the name of the field you want to associate a default value with as a string, and the default value you are associating as a variant. AlterDefaultValuewill fail if the default value cannot be stored in the field.

Once a default value is associated with a field in your object class, you can use the InitDefaultValuesmethod on IRowSubtypesto populate the fields in a object in your object class with its default value. This method is most often called after you have created a new feature or object in the object class, and before storing it.

IClassSchemaEdit.AlterDomain Method

The default domain of the object class field.

Public Sub AlterDomain ( _
    ByVal FieldName As String, _
    ByVal Domain As IDomain _
)
public void AlterDomain (
    string FieldName,
    IDomain Domain
);

Remarks

Domains are used in the Geodatabase to validate the contents of fields in an object class. For example, you can use a domain to specify a valid range of values, or a valid set of values for a particular field in an object class. You can assign domains to a field in an object class at either the class level, or the subtype level. The AlterDomainmethod on IClassSchemaEditallows you to set a domain for a field at the class level.

AlterDomaintakes as arguments the name of the field you want to associate a domain with as a string, and the domain you are associating as an IDomain. You can get an enumeration of domains in a workspace by calling the Domainsor DomainsByFieldTypemethods on the IWorkspaceDomainsinterface.

Once a domain is associated with a field in your object class, the values in that field will be validated against that domain when a row in the object class is validated with the IValidateinterface, or the Validate Selection command in the Editor.

IClassSchemaEdit.AlterFieldAliasName Method

The alias name of the object class field.

Public Sub AlterFieldAliasName ( _
    ByVal FieldName As String, _
    ByVal AliasName As String _
)
public void AlterFieldAliasName (
    string FieldName,
    string AliasName
);

Description

Alters the alias name for a field in the object class.

Remarks

Fields in object classes in a Geodatabase can have between one and three names. The name of the field, which is the same as the name of the field in the table in the DBMS in which the objects in the object class are stored, the alias name which the user can set for display purposes in end user applications. The third name is the model name which is a tool for developers of custom objects to use to guarantee the names of fields independent of the true name or alias name.

The AlterFieldAliasNamemethod sets the alias name for a field in the object class. The alias name can be returned using the IFieldinterface.

IClassSchemaEdit.AlterFieldModelName Method

The model name of the object class field.

Public Sub AlterFieldModelName ( _
    ByVal FieldName As String, _
    ByVal ModelName As String _
)
public void AlterFieldModelName (
    string FieldName,
    string ModelName
);

Description

Alters the model name for a field in the object class.

Remarks

Fields in object classes in a Geodatabase can have between one and three names. The name of the field, which is the same as the name of the field in the table in the DBMS in which the objects in the object class are stored, the alias name which the user can set for display purposes in end user applications. The third name is the model name which is a tool for developers of custom objects to use to guarantee the names of fields independent of the true name or alias name.

The AlterFieldModelNamemethod sets the model name for a field in the object class. The model name can be returned using the IModelInfointerface.

IClassSchemaEdit.AlterInstanceCLSID Method

Changes the instance COM class associated with this database class.

Public Sub AlterInstanceCLSID ( _
    ByVal InstanceCLSID As UID _
)
public void AlterInstanceCLSID (
    UID InstanceCLSID
);

Description

The AlterInstanceCLSIDis used to change the behavior class for an object class in the Geodatabase. For example, you may have a class that stores simple feature objects and you want to change it to implement a custom object that you have developed. You use the AlterInstanceCLSIDto do so.

Remarks

AlterInstanceCLSIDwill try to instantiate the object for the CLSID that you provide. If it fails to instantiate it, the method will fail. Therefore, you must have the DLL which has the implementation of your custom object registered on your system before you call AlterInstanceCLSID.

Before you QI for AlterInstanceCLSID, you will have had to open the object class. So, if this fails because you no longer have the DLL registered on your system, then you must use the IFeatureWorkspaceSchemaEditinterface to alter the instance CLSID.

No additional checking is done beyond instantiating the instance object. If the object class does not have the fields required for supporting the custom object then your class may not function with its new instance CLSID.

IClassSchemaEdit.AlterModelName Method

The model name of the object class.

Public Sub AlterModelName ( _
    ByVal Name As String _
)
public void AlterModelName (
    string Name
);

Description

Alters the model name for the object class.

Remarks

Object classes in a Geodatabase can have between one and three names. The name of the object class, which is the same as the name of the table in the DBMS in which the objects in the object class are stored, the alias name which the user can set for display purposes in end user applications. The third name is the model name which is a tool for developers of custom objects to use to guarantee the names of objects independent of the true name or alias name.

The AlterModelNamemethod sets the model name for the object class. The model name can be returned using the IModelInfointerface.

IClassSchemaEdit.RegisterAsObjectClass Method

Registers this class with the database, assigning it a class id and creating an object id column.

Public Function RegisterAsObjectClass ( _
    ByVal suggestedOIDFieldName As String, _
    ByVal ConfigKeyword As String _
) As Integer
public int RegisterAsObjectClass (
    string suggestedOIDFieldName,
    string ConfigKeyword
);

Description

The RegisterAsObjectClassmethod will register a table or feature class (ArcSDE layer) in the database with the Geodatabase. The act of registering the data as an object class will create records for the object class in the Geodatabase system tables and assign the object class a unique ID. Once a table or SDE layer is registered as an object class, it can participate in rules, topological relationships and relationships.

When registering a table or ArcSDE layer as an object class, an ObjectID field must be added to it. This field will contain the object IDs which uniquely identify each feature in the class. The object IDs for existing data will automatically be generated. Once a table or ArcSDE layer has been registered as an object class in the Geodatabase, it cannot be unregistered.

RegisterAsObjectClasstakes two arguments: the name of the object ID field, and the ArcSDE configuration keyword to use for storage of the new data that is inserted into the object ID field. RegisterAsObjectClass returns a long which is the object class ID assigned to the newly registered class.

Classes that implement IClassSchemaEdit

Classes Description
FeatureClass Esri Feature Class object.
ObjectClass Esri Object Class object.
RasterCatalog A collection of raster datasets in a Geodatabase table.

Remarks

When using the IClassSchemaEditobject to alter an object class' class schema, you should first acquire an exclusive schema lock using the ISchemaLockinterface to be sure that another application or user does not have the class open while you are trying to modify its schema.

You can QI for the IClassSchemaEditinterface from the IObjectClassinterface.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.