Share via


Principal 要素 (SSDL)

ストア スキーマ定義言語 (SSDL) の Principal 要素は、ReferentialConstraint 要素の子要素であり、外部キー制約 (参照制約) のプリンシパル End を定義します。 Principal 要素は、他の列に参照されるテーブル内の主キーの列を指定します。 PropertyRef 要素は、参照される列を指定します。 Dependent 要素は、Principal 要素で指定される主キーの列を参照する列を指定します。

The Principal element can have the following child elements (in the order listed):

適用可能な属性

The following table describes the attributes that can be applied to the Principal element.

属性名 必須 Value

Role

有効

対応するEnd 要素Role 属性 (使用されている場合) と同じ値です。そうでない場合は、参照される列を含んでいるテーブルの名前です。

Ee705456.note(ja-jp,VS.100).gif注 :
Principal 要素には、任意の数の annotation 属性 (カスタム XML 属性) を適用できます。However, custom attributes may not belong to any XML namespace that is reserved for CSDL.カスタム属性の完全修飾名は一意である必要があります。

The following example shows an Association element that uses a ReferentialConstraint element to specify the columns that participate in the FK_CustomerOrders foreign key constraint. Principal 要素は、制約のプリンシパル Endとして Customer テーブルの CustomerId 列を指定します。

<Association Name="FK_CustomerOrders">
  <End Role="Customers" 
       Type="ExampleModel.Store.Customers" Multiplicity="1">
    <OnDelete Action="Cascade" />
  </End>
  <End Role="Orders" 
       Type="ExampleModel.Store.Orders" Multiplicity="*" />
  <ReferentialConstraint>
    <Principal Role="Customers">
      <PropertyRef Name="CustomerId" />
    </Principal>
    <Dependent Role="Orders">
      <PropertyRef Name="CustomerId" />
    </Dependent>
  </ReferentialConstraint>
</Association>

参照

概念

エンティティ フレームワークの概要
SSDL 仕様

その他のリソース

CSDL、SSDL、および MSL 仕様
ADO.NET Entity Data Model Tools