다음을 통해 공유


Schema 요소(SSDL)

EDM(엔터티 데이터 모델)에서 Schema 요소는 저장소 메타데이터 사양의 루트 요소입니다. Schema 요소에는 저장소 모델의 이름과 데이터 형식을 사용하는 엔터티 및 연결에 대한 선언과 정의가 포함됩니다. 저장소 메타데이터는 SSDL(저장소 스키마 정의 언어)로 정의됩니다.

EntityTypeAssociation 요소는 Schema 요소의 자식 요소입니다. EntitySetAssociationSet 요소는 EntityContainer 요소의 자식 요소입니다.

EntityContainer 요소는 Schema 요소에 포함되지만 별개이며 논리적으로 독립적입니다. 매핑 사양에서 개념 스키마의 EntityContainer는 스키마 네임스페이스를 참조하지 않고도 저장소 메타데이터의 EntityContainer에 매핑됩니다.

다음 SSDL 스키마 예제에서는 Schema 요소와 이 요소에 포함된 가장 중요한 자식 요소를 보여 줍니다.

<?xml version="1.0" encoding="utf-8"?>
<Schema Namespace="AdventureWorksHRTarget" Alias="Self"
          xmlns="https://schemas.microsoft.com/ado/2006/04/edm/ssdl">

  <EntityType Name="Department">
    <Key>
        <PropertyRef Name="DepartmentID">
    </Key>
    <Property Name="DepartmentID" Type="smallint"
                Nullable="false" StoreGeneratedPattern="Identity" />
    <Property Name="Name" Type="nvarchar" 
                              Nullable="false" MaxLength="50" />
    <Property Name="GroupName" Type="nvarchar"
                              Nullable="false" MaxLength="50" />
    <Property Name="ModifiedDate" Type="datetime" Nullable="false" />
  </EntityType>

<EntityType Name="Employee" >
    <Key>
        <PropertyRef Name="EmployeeID">
    </Key>
    <Property Name="EmployeeID" Type="int" Nullable="false"
                                  StoreGeneratedPattern="Identity" />
    <Property Name="NationalIDNumber" Type="nvarchar"
                              Nullable="false" MaxLength="15" />
    <Property Name="ContactID" Type="int" Nullable="false" />
    <Property Name="LoginID" Type="nvarchar" 
                             Nullable="false" MaxLength="256" />
    <Property Name="ManagerID" Type="int" />
    <Property Name="Title" Type="nvarchar" Nullable="false"
                                                   MaxLength="50" />
    <Property Name="BirthDate" Type="datetime" Nullable="false" />
    <Property Name="MaritalStatus" Type="nchar" Nullable="false"
                                  MaxLength="1" FixedLength="true" />
    <Property Name="Gender" Type="nchar" Nullable="false"
                              MaxLength="1" FixedLength="true" />
    <Property Name="HireDate" Type="datetime" Nullable="false" />
    <Property Name="SalariedFlag" Type="bit" Nullable="false" />
    <Property Name="VacationHours" Type="smallint" Nullable="false" />
    <Property Name="SickLeaveHours" Type="smallint" Nullable="false" />
    <Property Name="CurrentFlag" Type="bit" Nullable="false" />
    <Property Name="rowguid" Type="uniqueidentifier" Nullable="false" />
    <Property Name="ModifiedDate" Type="datetime" Nullable="false" />
  </EntityType>

<EntityContainer Name="HumanResources">
    <EntitySet Name="Department" EntityType="Self.Department" />
    <EntitySet Name="Employee" EntityType="Self.Employee" />
    <AssociationSet Name="Employee_EmployeeManagerID"
                  Association="Self.Employee_EmployeeManagerID">
      <End Role="Employee" EntitySet="Employee" />
      <End Role="Employee" EntitySet="Employee" />
    </AssociationSet>
  </EntityContainer>

</Schema>

Schema 형식의 Namespace 특성과 Schema 요소의 자식 요소(예: EntityTypeAssociation)는 다음 항목에서 함수와 함께 설명합니다.

Namespace 특성(SSDL)

EntityType 요소(SSDL)

Association 요소(SSDL)

이러한 각 형식에는 SSDL 스키마로 된 자식 요소가 있습니다.

참고 항목

개념

EntityContainer 요소(SSDL)
엔터티 구현(EDM)
연결 구현(EDM)

기타 리소스

EDM 사양