エンティティ データ モデル (EDM) では、ストア スキーマ定義言語 (SSDL) の Association 定義に、設計対象のオブジェクト モデルおよびマッピング スキーマの型を識別する Name 属性が含まれています。
次の Adventure Works モデルの Human Resources パーティションでの宣言は、Employee エンティティ宣言を示します。Name 属性には Name="FK_Employee_Employee_ManagerID"
が割り当てられます。このアソシエーションは、Employee エンティティ間のものです。Employee エンティティの 1 つは、マネージャとして指定されます。ここで使用されている命名規則は、アソシエーションがデータベース内の Employee テーブルの ManagerID 外部キーに基づいていることを示しています。
<Association Name="FK_Employee_Employee_ManagerID">
<End Role="Employee" Type="Adventureworks.Store.Employee" Multiplicity="0..1" />
<End Role="Employee1" Type="Adventureworks.Store.Employee" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Employee">
<PropertyRef Name="EmployeeID" />
</Principal>
<Dependent Role="Employee1">
<PropertyRef Name="ManagerID" />
</Dependent>
</ReferentialConstraint>
</Association>
参照
概念
Association 要素 (SSDL)
AdventureWorks Complete Model (EDM)
ReferentialConstraint 要素 (アソシエーション SSDL)