Share via


AdventureWorks 전체 모델(EDM)

다수의 EDM(엔터티 데이터 모델) 기반 응용 프로그램에는 이미 사용 중인 데이터베이스에 대한 매핑 스키마가 있어야 합니다. 기존 데이터로의 매핑은 개념적 디자인 완료 후 저장소 모델을 구현하는 작업보다 더 복잡합니다.

SQL Server에 포함된 AdventureWorks 데이터베이스는 SQL Server의 기능을 보여 주도록 설계된 대용량 표준화 데이터베이스입니다. AdventureWorks 데이터베이스의 5개 하위 섹션이 있으며, 이러한 섹션은 모두 CSDL(개념 스키마 정의 언어)을 사용하여 단일 EntityContainer에 지정할 수 있습니다. 저장소 모델은 SSDL(저장소 스키마 정의 언어)의 메타데이터로 설명됩니다. 개념 스키마와 저장소 스키마 사이의 매핑은 MSL(매핑 사양 언어)로 수행됩니다.

다음 항목의 스키마는 모두 명령줄 도구 EdmGen.exe를 사용하여 생성되었습니다. 사용된 단일 명령의 구문에는 /FullGeneration 및 /Project:AdventureWorks, /Provider 스위치 및 AdventureWorks 데이터베이스에 대한 연결 문자열이 포함됩니다.

C:\>%windir%\Microsoft.NET\Framework\v3.5\edmgen.exe /mode:fullgeneration /project:AdventureWorks
 /provider:System.Data.SqlClient 
/connectionstring:"server=.\sqlExpress;
integrated security=true;database=AdventureWorks" /outssdl:c:\BuildSchemas\AdventureWorks.ssdl /outcsdl:c:\BuildSchemas\AdventureWorks.csdl 
/outmsl:c:\BuildSchemas\AdventureWorks.msl 
/outViews:c:\BuildSchemas\AdventureWorks.Views.cs
 /outObjectLayer:c:\BuildSchemas\AdventureWorks.ObjectLayer.cs

도구를 사용하여 이 대용량 데이터베이스에 대한 스키마가 올바르게 생성되었습니다. CSDL 스키마는 AdventureWorks 데이터베이스의 다른 모든 기능을 활용할 수 있도록 프로그래밍 가능 개체를 빌드하는 데 사용되는 사양입니다. 출력되는 결과는 다음과 같습니다.

Microsoft (R) EdmGen version 3.5.0.0
Copyright © Microsoft Corporation 2007. All rights reserved.

Loading database information...
warning 6002: The table/view 'AdventureWorks.HumanResources.vEmployee' does not
have a primary key defined. The key has been inferred and the definition was cre
ated as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.HumanResources.vEmployeeDepartment'
 does not have a primary key defined. The key has been inferred and the definiti
on was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.HumanResources.vEmployeeDepartmentH
istory' does not have a primary key defined. The key has been inferred and the d
efinition was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.HumanResources.vJobCandidate' does
not have a primary key defined. The key has been inferred and the definition was
 created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.HumanResources.vJobCandidateEducati
on' does not have a primary key defined. The key has been inferred and the defin
ition was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.HumanResources.vJobCandidateEmploym
ent' does not have a primary key defined. The key has been inferred and the defi
nition was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Person.vAdditionalContactInfo' does
 not have a primary key defined. The key has been inferred and the definition wa
s created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Person.vStateProvinceCountryRegion'
 does not have a primary key defined. The key has been inferred and the definiti
on was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Production.vProductAndDescription'
does not have a primary key defined. The key has been inferred and the definitio
n was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Production.vProductModelCatalogDesc
ription' does not have a primary key defined. The key has been inferred and the
definition was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Production.vProductModelInstruction
s' does not have a primary key defined. The key has been inferred and the defini
tion was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Purchasing.vVendor' does not have a
 primary key defined. The key has been inferred and the definition was created a
s a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Sales.vIndividualCustomer' does not
 have a primary key defined. The key has been inferred and the definition was cr
eated as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Sales.vIndividualDemographics' does
 not have a primary key defined. The key has been inferred and the definition wa
s created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Sales.vSalesPerson' does not have a
 primary key defined. The key has been inferred and the definition was created a
s a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Sales.vSalesPersonSalesByFiscalYear
s' does not have a primary key defined. The key has been inferred and the defini
tion was created as a read-only table/view.
warning 6002: The table/view 'AdventureWorks.Sales.vStoreWithDemographics' does
not have a primary key defined. The key has been inferred and the definition was
 created as a read-only table/view.
Writing ssdl file...
Creating conceptual layer from storage layer...
Writing msl file...
Writing csdl file...
Writing object layer file...
Writing views file...

Generation Complete -- 0 errors, 17 warnings

단원 내용

AdventureWorks 데이터에 대한 스키마와 매핑에 대한 자세한 내용은 다음 항목을 참조하십시오.

참고 항목

기타 리소스

EDM 사양
스키마 및 매핑 사양(Entity Framework)
스키마 및 매핑 사양(Entity Framework)