Interface IMemoryRelationshipClassName
- Namespace
- ESRI.ArcGIS.Geodatabase
- Assembly
- ESRI.Server.Geodatabase.dll
Provides access to members that define a memory relationship class name.
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("91DBC553-EB2D-11D3-9F84-00C04F6BC886")]
public interface IMemoryRelationshipClassName
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.
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();}
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
Properties
BackwardPathLabel
The back label of the relationship.
string BackwardPathLabel { get; set; }
Property Value
DestinationName
The name object of the destination class of the memory relationship.
IName DestinationName { get; set; }
Property Value
ForwardPathLabel
The forward label of the relationship.
string ForwardPathLabel { get; set; }
Property Value
OriginForeignKey
Origin foreign key field name.
string OriginForeignKey { get; set; }
Property Value
Remarks
This is the name of the field from the table referenced by the DestinationName property.
OriginName
The name object for the origin table of the memory relationship.
IName OriginName { get; set; }
Property Value
OriginPrimaryKey
Origin primary key field name.
string OriginPrimaryKey { get; set; }
Property Value
Remarks
This is the name of the field from the table referenced by the OriginName property.