Relation Definition Meta-data
The Relation meta-data contains attributes for creating a relation between two classes. In order to define the relation, the Class definition must already be created for both the parent and child classes. In the Commerce Server 2002 Data Warehouse, most relations are of the one-to-many type.
To link two classes, the ParentClassName attribute for the Relation must be set to the ClassDefName of the parent Class object. Likewise, the ChildClassName attribute for the Relation must be set to the ClassDefName of the child Class object.
To link non-Key class members of the parent class, create a Relation Member that defines the members to link for the relation.
For information about creating a new relation between two existing classes, see Creating a New Class Relation.
The Relation definition meta-data contains an attribute used to define the type of the relation (RelType). The following table contains the valid relation types and the corresponding type codes.
Relation Type | Code | Description |
---|---|---|
One-to-Many | 2 | Each parent has zero or more children, each child has one parent. The identifier ("Classname" ID) of the parent is used as a foreign key by the child. |
Many-to-Many | 3 | Each parent has zero or more children, each child has one or more parents. |
One-to-Many with Inheritance | 194 | Same as one-to-many except all members of the parent are visible to the children. (In a regular one-to-many relation, only the key members of the parent class are visible by default.) |
The following table shows the attributes used for the class relation definitions. A set of these attributes is stored in the Relation table for each class relation defined.
The following terminology describes the attribute requirements listed in the table.
- A value in quotes is required and must be supplied by the user.
- An unquoted value indicates the default, which can be overridden by the user.
- "Leave blank" indicates that the attribute should not be assigned.
- "Optional" indicates that the value is user-assigned but can be left blank.
- "Required" indicates that the value is user-assigned and required.
Attribute | Data Type | Constraint | Requirement | Description |
---|---|---|---|---|
RelationID | int | NOT NULL | Leave blank | Stores the unique identifier for the relation. |
CatalogID | int | NULL | Leave blank | Stores the identifier for the schema catalog. |
CatalogName | nvarchar (128) | NULL | Leave blank | Stores the name of the schema catalog, "DWSchema." |
ChildClassID | int | NULL | Leave blank | Stores the class identifier of the child class for the relation. |
ChildClassName | nvarchar (57) | NULL | Required | Stores the name of the child class for the relation. |
CreatedTime | datetime | NULL | Reserved | Records when the relation was created. |
Description | nvarchar (128) | NULL | Optional | Stores the description of the object. |
DisplayName | nvarchar (128) | NULL | Optional | Stores the display name of the object. |
MajorVersion | int | NULL | Reserved | Stores the major version number for the relation. |
MinorVersion | int | NULL | Reserved | Stores the minor version number for the relation. |
ModifiedTime | datetime | NULL | Reserved | Records when the relation was last modified. |
ParentClassID | int | NULL | Leave blank | Stores the class identifier of the parent class for the relation. |
ParentClassKey | nvarchar (128) | NULL | Required | Stores the name of the key for the parent class. |
ParentClassName | nvarchar (57) | NULL | Required | Stores the name of the parent class for the relation. |
RelationName | nvarchar (128) | NULL | Required | Stores the name of the relation. |
RefMemName | nvarchar (100) | NULL | Leave blank | Reserved. |
RelType | smallint | NULL | Required | Stores the type of the relation. |
Status | int | NULL | Reserved | Reserved. |
Copyright © 2005 Microsoft Corporation.
All rights reserved.