Interface IClass

Namespace
ESRI.ArcGIS.Geodatabase
Assembly
ESRI.Server.Geodatabase.dll

Provides access to members that return information about and manage the class.

[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("1AFCDB32-AC09-11D2-8A1E-006097AFF44E")]
public interface IClass

Remarks

All tables support the IClass interface.

The CLSID property returns the globally unique identifier for the software component (COM coclass) representing the row objects stored and handed out by this table. Examples of the value of this property include the CLSIDs representing esriGeoDatabase.Row, esriGeoDatabase.Object, esriGeoDatabase.Feature, and esriGeoDatabase.AttributedRelationship.

The EXTCLSID property returns the globally unique identifier for the software component (COM coclass) representing the class extension associated with this Table. Class extensions are a mechanism whereby a developer can associate additional class level methods with an ObjectClass in the database.

The CLSID and EXTCLSID and other similar properties for a Table are stored in the geodatabase as part of the data dictionary information for the database. These properties link the behavior of the class (as implemented by software components in a DLL) with the data in the table.

The Extension property returns an interface on the ClassExtension associated with this Table.

The HasOID property may be used to test if this table has an Object ID column. Tables representing object classes and attributed relationship classes in a geodatabase will have an Object ID column whose values are unique and are assigned by the geodatabase as new objects and attributed relationships are created. The “Register With Geodatabase” command available on the context menu of a table in ArcCatalog can be used to register a pre-existing table in an RDBMS as an object class, this process will add an Object ID column to the table if needed.

The IClass interface also contains methods (inherited by ITable) to manage the collection of fields and indexes for a Table.

Properties

CLSID

The GUID for the COM Class (CoClass) corresponding to instances of this object class.

UID CLSID { get; }

Property Value

UID

EXTCLSID

The GUID for the COM Class (CoClass) corresponding to the class extension for this object class.

UID EXTCLSID { get; }

Property Value

UID

Extension

The extension for this object class.

object Extension { get; }

Property Value

object

ExtensionProperties

The extension properties for this object class.

IPropertySet ExtensionProperties { get; }

Property Value

IPropertySet

Fields

The fields collection for this object class.

IFields Fields { get; }

Property Value

IFields

Remarks

<P>Each table in a database has an ordered collection of fields, there is always at least one field in a table. The ordered collection behaves like a list, so it is possible to access individual fields by a numbered position (or index) in the list.</P> <P>A <STRONG>Fields </STRONG>collection can also exist independently of a table, for example when creating an index on a table you will need to define which fields take part in the index. There are many interfaces which either require or return a <STRONG>Fields </STRONG>collection; these include <STRONG>IClass </STRONG>(therefore also <STRONG>IObjectClass </STRONG>and <STRONG>IFeatureClass</STRONG>), <STRONG>ICursor</STRONG>, <STRONG>IIndex</STRONG>, <STRONG>IFeatureClassDraw</STRONG>, <STRONG>IRowBuffer</STRONG>, <STRONG>ISimpleDataConverter</STRONG>, <STRONG>ITableSort </STRONG>and <STRONG>IValidate</STRONG>.</P>

HasOID

Indicates if the class has an object identity (OID) field.

bool HasOID { get; }

Property Value

bool

Indexes

The indexes collection for this object class.

IIndexes Indexes { get; }

Property Value

IIndexes

Remarks

<P>The <STRONG>Indexes </STRONG>object represents a collection of indexes on a table. Indexes are designed to improve access times to data. The <STRONG>Indexes </STRONG>collection object operates in a very similar way to the Fields collection object.</P>

OIDFieldName

The name of the field corresponding to the OID.

string OIDFieldName { get; }

Property Value

string

Methods

AddField(IField)

Adds a field to this object class.

void AddField(IField Field)

Parameters

Field IField

Remarks

Prior to adding a new field to a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

Attempting to add a new field that does not allow null values will fail, if the class already has data in it. The only solution is to recreate the class with the non-nullable field, then copy the rows from the original class into the new class.

AddIndex(IIndex)

Adds an index to this object class.

void AddIndex(IIndex Index)

Parameters

Index IIndex

Remarks

Prior to adding a new index to a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

DeleteField(IField)

Deletes a field from this object class.

void DeleteField(IField Field)

Parameters

Field IField

Remarks

DeleteField removes the specified field from a table, object class or feature class. Fields that are required by the Geodatabase and cannot be removed include:

  • OBJECTID field
  • SHAPE and shape dependent fields such as SHAPE_Length
  • Enabled, AncillaryRole and Weight field for network feature classes
  • Subtype fields. In order to delete a subtype field, it must first be removed as the subtype field, see the help on ISubtypes::SubtypeFieldName

Prior to deleting a field from a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

DeleteIndex(IIndex)

Deletes an index from this object class.

void DeleteIndex(IIndex Index)

Parameters

Index IIndex

Remarks

Prior to deleting an index from a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

FindField(string)

The index of the field with the specified name.

int FindField(string Name)

Parameters

Name string

Returns

int

Remarks

If FindField returns -1, the Field could not be found in the Fields collection.

Developers working with SDE should be aware of qualified field names and their impact on calls to FindField. For more information, see the IFields2 interface.