다음을 통해 공유


Schema 요소(CSDL)

Schema 요소는 EDM(엔터티 데이터 모델)에서 개념 스키마의 루트 요소입니다. Schema 요소는 정의되는 개체 모델에서 사용되는 엔터티 및 연결이 들어 있는 Namespace의 사양입니다. 개념 스키마는 CSDL(개념 스키마 정의 언어)에 정의됩니다. 개념 스키마에서 EntityTypeAssociation 요소는 Schema 요소의 자식 요소입니다.

EntityContainer 요소는 디자인되는 개체 모델의 클래스 사양입니다. EntitySetAssociationSetEntityContainer의 자식 요소입니다.

EntityTypeAssociation 요소에 대한 자세한 내용은 이 단원의 하위 항목을 참조하십시오. EntityContainer 요소에 대한 자세한 내용은 EntityContainer 요소(CSDL)를 참조하십시오.

다음 스키마 선언에서는 Schema 요소 및 해당 자식 요소를 보여 줍니다.

<Schema Namespace="AdventureWorksHRModel" Alias="Self" 
             xmlns="https://schemas.microsoft.com/ado/2006/04/edm">

  <EntityType Name="Department" 
    <Key>
        <PropertyRef Name="DepartmentID" />
    </Key>
    <Property Name="DepartmentID" Type="Int16" Nullable="false" />
    <Property Name="Name" Type="String" Nullable="false" />
    <Property Name="GroupName" Type="String" Nullable="false" />
    <Property Name="ModifiedDate" Type="DateTime" Nullable="false" />
  </EntityType>

  <EntityType Name="Employee"
    <Key>
        <PropertyRef Name=EmployeeID>
    </Key>
    <Property Name="EmployeeID" Type="Int32" Nullable="false" />
    <Property Name="NationalIDNumber" Type="String" Nullable="false" />
    <Property Name="ContactID" Type="Int32" Nullable="false" />
    <Property Name="LoginID" Type="String" Nullable="false"/>
    <Property Name="Title" Type="String" Nullable="false" />
    <Property Name="BirthDate" Type="DateTime" Nullable="false" />
    <Property Name="MaritalStatus" Type="String" Nullable="false"
/>
    <Property Name="Gender" Type="String" Nullable="false"/>
    <Property Name="HireDate" Type="DateTime" Nullable="false" />
    <Property Name="SalariedFlag" Type="Boolean" Nullable="false" />
    <Property Name="VacationHours" Type="Int16" Nullable="false" />
    <Property Name="SickLeaveHours" Type="Int16" Nullable="false" />
    <Property Name="CurrentFlag" Type="Boolean" Nullable="false" />
    <Property Name="rowguid" Type="Guid" Nullable="false" />
    <Property Name="ModifiedDate" Type="DateTime" Nullable="false" />
  </EntityType>

  <Association Name="Employee_EmployeeManagerID">
        <End Role="Employee" Type="Self.Employee" Multiplicity="0..1" />
        <End Role="Employee" Type="Self.Employee" Multiplicity="0..*" />
  </Association>

  <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="Employee63" EntitySet="Employee" />
    </AssociationSet>
  </EntityContainer>

</Schema>

CSDL 스키마 사양은 MSL(매핑 사양 언어)의 SSDL(저장소 스키마 정의 언어) 사양에 매핑됩니다.

단원 내용

이 단원의 항목에서는 EDM을 기반으로 하는 개체 모델의 구현에 쓰이는 형식과 요소에 대해 설명합니다. Schema 요소와 Schema 요소의 EntityType, Association 등의 자식 요소의 Namespace 특성은 다음 항목에 설명되어 있습니다.

Namespace 특성(CSDL)

EntityType 요소(CSDL)

Association 요소(CSDL)

이러한 각 형식은 CSDL 스키마에서 자식 요소를 가집니다.

참고 항목

개념

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

기타 리소스

EDM 사양