Das vollständige AdventureWorks-Modell (EDM)

Viele Anwendungen, die auf dem Entitätsdatenmodell (EDM) basieren, erfordern Mappingschemas zu einer Datenbank, die bereits verwendet wird. Das Mapping zu vorhandenen Daten ist komplexer als die Implementierung des Speichermodells nach Beendigung des konzeptionellen Entwurfs.

Die in SQL Server enthaltene AdventureWorks-Datenbank ist eine umfangreiche, normalisierte Datenbank, die zur Demonstration der Features von SQL Server entworfen wurde. Es gibt fünf Unterabschnitte der AdventureWorks-Datenbank, die alle mit einem einzigen EntityContainer mit der konzeptionellen Schemadefinitionssprache (CSDL) angegeben werden können. Das Speichermodell wird durch Metadaten in der Datenspeicherschema-Definitionssprache (SSDL) beschrieben. Das Mapping von konzeptionellem Schema und Speicherschema erfolgt in der Mapping-Spezifikationssprache (MSL).

In den folgenden Themen wurden alle Schemas mit dem Befehlszeilentool EdmGen.exe generiert. Die Syntax des verwendeten Befehls enthält die Schalter /FullGeneration, /Project:AdventureWorks, /Provider und einen Verbindungszeichenfolge zur AdventureWorks-Datenbank.

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

Die Schemas für diese sehr große Datenbank wurden ordnungsgemäß durch das Tool generiert. Das CSDL-Schema stellt die Spezifikation dar, die zum Erstellen von programmierbaren Objekten für alle anderen Features der AdventureWorks-Datenbank verwendet wurde. Die Ausgabe ist im Folgenden dargestellt.

Microsoft (R) EdmGen version 3.5.0.0
Copyright (C) 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

In diesem Abschnitt

Die folgenden Themen enthalten die Schemas und Mappings für die AdventureWorks-Daten.

Siehe auch

Weitere Ressourcen

EDM-Spezifikationen
Schemas und Mappingspezifikation (Entity Framework)
Schemas und Mappingspezifikation (Entity Framework)