ArcObjects Library Reference (GeoDatabase)  

IMemoryRelationshipClassName Interface

Provides access to members that define a memory relationship class name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Description
Read/write property BackwardPathLabel The back label of the relationship.
Read/write property DestinationName The name object of the destination class of the memory relationship.
Read/write property ForwardPathLabel The forward label of the relationship.
Read/write property OriginForeignKey Origin foreign key field name.
Read/write property OriginName The name object for the origin table of the memory relationship.
Read/write property OriginPrimaryKey Origin primary key field name.

CoClasses that implement IMemoryRelationshipClassName

CoClasses and Classes Description
MemoryRelationshipClassName A name class that represents as in memory relationship class.

Remarks

The IMemoryRelationshipClassName interface contains properties that correspond to the parameters used with the IMemoryRelationshipClassFactory::Open method. These include the Origin and Destination tables, the fields and the forward and backward path names.

The only parameters from the IMemoryRelationshipClassFactory::Open method that don't have a corresponding property in IMemoryRelationshipClassName are the name and the cardinality. The name can be set using the IDatasetName interface and the cardinality can be set using the IRelationshipClassName interface. Both of these interfaces are inherited by MemoryRelationshipClassName.

The diagram below describes the associations that define a MemoryRelationshipClass .

Since a MemoryRelationshipClass implements IDataset, you can use the IDataset::FullName property to get a MemoryRelationshipClassName object that corresponds to an existing MemoryRelationshipClass.

See the IName interface topic for more information on Name objects in general.

[C#]

The example below creates a new MemoryRelationshipClass using name objects.

public static IRelationshipClass CreateMemRelClass(IName originName, IName destinationName, String originField, String destField)
{
 // Set the memory relationship class properties.
 IMemoryRelationshipClassName memoryRelationshipClassName = new MemoryRelationshipClassNameClass
 {
  OriginName = originName,
  DestinationName = destinationName,
  OriginPrimaryKey = originField,
  OriginForeignKey = destField,
  ForwardPathLabel = "FWD",
  BackwardPathLabel = "BACK"
 };
 // Set the relationship class properties.
 IRelationshipClassName relationshipClassName = (IRelationshipClassName)memoryRelationshipClassName;
 relationshipClassName.Cardinality = esriRelCardinality.esriRelCardinalityOneToOne;
 IDatasetName datasetName = (IDatasetName)relationshipClassName;
 datasetName.Name = "New_MemRC";
 // Open and return the memory relationship class.
 IName name = (IName)relationshipClassName;
 return (IRelationshipClass)name.Open();
}
[Visual Basic .NET]

The example below creates a new MemoryRelationshipClass using name objects.

Public Shared Function CreateMemRelClass(ByVal originName As IName, ByVal destinationName As IName, _
 ByVal originField As String, ByVal destField As String) As IRelationshipClass
 ' Set the memory relationship class properties.
 Dim memoryRelationshipClassName As IMemoryRelationshipClassName = New MemoryRelationshipClassNameClass With _
 { _
  .OriginName = originName, _
  .DestinationName = destinationName, _
  .OriginPrimaryKey = originField, _
  .OriginForeignKey = destField, _
  .ForwardPathLabel = "FWD", _
  .BackwardPathLabel = "BACK" _
 }
 ' Set the relationship class properties.
 Dim relationshipClassName As IRelationshipClassName = CType(memoryRelationshipClassName, IRelationshipClassName)
 relationshipClassName.Cardinality = esriRelCardinality.esriRelCardinalityOneToOne
 Dim datasetName As IDatasetName = CType(relationshipClassName, IDatasetName)
 datasetName.Name = "New_MemRC"
 ' Open and return the memory relationship class.
 Dim name As IName = CType(relationshipClassName, IName)
 Return CType(name.Open(), IRelationshipClass)
End Function

See Also

IRelationshipClass Interface | IMemoryRelationshipClassFactory Interface | IName Interface

.NET Related Topics

Geodatabase