Added:
trunk/MySql.Data.Entity/Tests/RelationalOperators.cs
trunk/MySql.Data.Entity/Tests/TestModel.csdl
trunk/MySql.Data.Entity/Tests/TestModel.msl
trunk/MySql.Data.Entity/Tests/TestModel.ssdl
Removed:
trunk/MySql.Data.Entity/Tests/TestDB.csdl
trunk/MySql.Data.Entity/Tests/TestDB.msl
trunk/MySql.Data.Entity/Tests/TestDB.ssdl
trunk/MySql.Data.Entity/Tests/TestModel.edmx
Modified:
trunk/MySql.Data.Entity/Provider/Generators/SelectGenerator.cs
trunk/MySql.Data.Entity/Provider/Generators/SqlGenerator.cs
trunk/MySql.Data.Entity/Provider/Statements/SelectStatement.cs
trunk/MySql.Data.Entity/Tests/App.Config
trunk/MySql.Data.Entity/Tests/MySql.Data.Entity.Tests.csproj
Log:
moved back to using separate files since edmx code generation doesn't seem to currently support complex types. Working pretty nice now though with the entitycodegenerator custom tool instead of my post build events calling out to edmgen
Modified: trunk/MySql.Data.Entity/Provider/Generators/SelectGenerator.cs
===================================================================
--- trunk/MySql.Data.Entity/Provider/Generators/SelectGenerator.cs 2009-01-20 20:51:10 UTC (rev 1495)
+++ trunk/MySql.Data.Entity/Provider/Generators/SelectGenerator.cs 2009-01-21 17:20:41 UTC (rev 1496)
@@ -37,7 +37,6 @@
switch (commandTree.Query.ExpressionKind)
{
case DbExpressionKind.Project:
- scope.Push(null);
fragment = e.Accept(this);
break;
}
@@ -47,8 +46,8 @@
public override SqlFragment Visit(DbFilterExpression expression)
{
- scope.Push(expression.Input.VariableName);
SqlFragment input = expression.Input.Expression.Accept(this);
+ input.Name = expression.Input.VariableName;
(Current as SelectStatement).Where.Add(expression.Predicate.Accept(this));
@@ -57,8 +56,8 @@
public override SqlFragment Visit(DbGroupByExpression expression)
{
- scope.Push(expression.Input.VariableName);
SqlFragment input = expression.Input.Expression.Accept(this);
+ input.Name = expression.Input.VariableName;
CollectionType ct = (CollectionType)expression.ResultType.EdmType;
RowType rt = (RowType)ct.TypeUsage.EdmType;
@@ -96,23 +95,19 @@
//Current.HashFragment(scope.Peek() + "." + names[agg], lf);
Pop();
}
- scope.Pop();
return input;
}
public override SqlFragment Visit(DbJoinExpression expression)
{
JoinFragment join = new JoinFragment();
- join.Name = scope.Peek();
join.JoinType = Metadata.GetOperator(expression.ExpressionKind);
- scope.Push(expression.Left.VariableName);
join.Left = expression.Left.Expression.Accept(this);
- Current.IndexFragment(join.Left, scope.Peek());
+ join.Left.Name = expression.Left.VariableName;
- scope.Push(expression.Right.VariableName);
join.Right = expression.Right.Expression.Accept(this);
- Current.IndexFragment(join.Right, scope.Pop());
+ join.Right.Name = expression.Right.VariableName;
// now handle the ON case
join.Condition = expression.JoinCondition.Accept(this);
@@ -147,7 +142,6 @@
private SqlFragment HandleNewInstanceAsInput(DbNewInstanceExpression expression)
{
SelectStatement statement = new SelectStatement(CurrentSelect);
- statement.Name = scope.Pop();
if (expression.Arguments.Count == 0)
{
@@ -164,12 +158,11 @@
public override SqlFragment Visit(DbProjectExpression expression)
{
SelectStatement statement = new SelectStatement(Current as SelectStatement);
- statement.Name = scope.Pop();
selectStatements.Push(statement);
// handle from clause
- scope.Push(expression.Input.VariableName);
statement.Input = expression.Input.Expression.Accept(this);
+ statement.Input.Name = expression.Input.VariableName;
// now handle projection
statement.Output = expression.Projection.Accept(this);
@@ -182,8 +175,9 @@
{
ListFragment list = new ListFragment(" ");
- scope.Push(expression.Input.VariableName);
- list.Items.Add(expression.Input.Expression.Accept(this));
+ SqlFragment fragment = expression.Input.Expression.Accept(this);
+ fragment.Name = expression.Input.VariableName;
+ list.Items.Add(fragment);
list.Items.Add(new SqlFragment("ORDER BY"));
ListFragment clauses = new ListFragment(", ");
Modified: trunk/MySql.Data.Entity/Provider/Generators/SqlGenerator.cs
===================================================================
--- trunk/MySql.Data.Entity/Provider/Generators/SqlGenerator.cs 2009-01-20 20:51:10 UTC (rev 1495)
+++ trunk/MySql.Data.Entity/Provider/Generators/SqlGenerator.cs 2009-01-21 17:20:41 UTC (rev 1496)
@@ -14,7 +14,7 @@
private List<MySqlParameter> parameters;
protected string tabs = String.Empty;
private int parameterCount = 1;
- protected Stack<string> scope = new Stack<string>();
+ //protected Stack<string> scope = new Stack<string>();
private BaseStatement current;
public SqlGenerator()
@@ -85,7 +85,6 @@
table = property.Value as string;
fragment.Text = String.Format("`{0}`.`{1}`", schema, table);
}
- fragment.Name = scope.Pop();
return fragment;
}
@@ -171,7 +170,19 @@
public override SqlFragment Visit(DbUnionAllExpression expression)
{
- throw new NotImplementedException();
+ ListFragment list = new ListFragment(" ");
+
+ SqlFragment left = expression.Left.Accept(this);
+ Debug.Assert(left is SelectStatement);
+ list.Items.Add(left);
+
+ list.Items.Add(new SqlFragment("UNION ALL"));
+
+ SqlFragment right = expression.Right.Accept(this);
+ Debug.Assert(right is SelectStatement);
+ list.Items.Add(right);
+
+ return list;
}
Modified: trunk/MySql.Data.Entity/Provider/Statements/SelectStatement.cs
===================================================================
--- trunk/MySql.Data.Entity/Provider/Statements/SelectStatement.cs 2009-01-20 20:51:10 UTC (rev 1495)
+++ trunk/MySql.Data.Entity/Provider/Statements/SelectStatement.cs 2009-01-21 17:20:41 UTC (rev 1496)
@@ -48,7 +48,9 @@
sql.AppendFormat("{0}", Limit);
}
if (Parent != null)
- sql.AppendFormat(") AS {0}", QuoteIdentifier(Name));
+ sql.Append(")");
+ if (Name != null)
+ sql.AppendFormat("AS {0}", QuoteIdentifier(Name));
return sql.ToString();
}
}
Modified: trunk/MySql.Data.Entity/Tests/App.Config
===================================================================
--- trunk/MySql.Data.Entity/Tests/App.Config 2009-01-20 20:51:10 UTC (rev 1495)
+++ trunk/MySql.Data.Entity/Tests/App.Config 2009-01-21 17:20:41 UTC (rev 1496)
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
- <add name="testDB" connectionString="metadata=TestDB.csdl|TestDB.msl|TestDB.ssdl;provider=MySql.Data.MySqlClient;provider connection string="Data Source=localhost;database=test;uid=root"" providerName="System.Data.EntityClient" />
- <add name="testDBOld" connectionString="metadata=res://*/TestDB.csdl|res://*/TestDB.ssdl|res://*/TestDB.msl;provider=MySql.Data.MySqlClient;provider connection string="Data Source=localhost;database=test;uid=root"" providerName="System.Data.EntityClient" />
- <add name="testEntities" connectionString="metadata=res://*/TestModel.csdl|res://*/TestModel.ssdl|res://*/TestModel.msl;provider=MySql.Data.MySqlClient;provider connection string="server=localhost;database=test;uid=root"" providerName="System.Data.EntityClient" />
+ <add name="testEntities" connectionString="metadata=TestModel.csdl|TestModel.msl|TestModel.ssdl;provider=MySql.Data.MySqlClient;provider connection string="Data Source=localhost;database=test;uid=root"" providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>
\ No newline at end of file
Modified: trunk/MySql.Data.Entity/Tests/MySql.Data.Entity.Tests.csproj
===================================================================
--- trunk/MySql.Data.Entity/Tests/MySql.Data.Entity.Tests.csproj 2009-01-20 20:51:10 UTC (rev 1495)
+++ trunk/MySql.Data.Entity/Tests/MySql.Data.Entity.Tests.csproj 2009-01-21 17:20:41 UTC (rev 1496)
@@ -54,6 +54,7 @@
<Compile Include="BaseEdmTest.cs" />
<Compile Include="AggregateOperators.cs" />
<Compile Include="CanonicalFunctions.cs" />
+ <Compile Include="RelationalOperators.cs" />
<Compile Include="SetOperators.cs" />
<Compile Include="Paging.cs" />
<Compile Include="OrderingAndGrouping.cs" />
@@ -61,13 +62,12 @@
<Compile Include="TestModel.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
- <DependentUpon>TestModel.edmx</DependentUpon>
+ <DependentUpon>TestModel.csdl</DependentUpon>
</Compile>
<Compile Include="UpdateTests.cs" />
<Compile Include="DeleteTests.cs" />
<Compile Include="RestrictionOperators.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
- <None Include="TestDB.ObjectLayer.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\MySql.Data\Provider\MySql.Data.csproj">
@@ -86,13 +86,12 @@
<ItemGroup>
<None Include="App.Config" />
<None Include="Properties\schema.sql" />
- <EntityDeploy Include="TestModel.edmx">
+ <EmbeddedResource Include="TestModel.csdl">
<Generator>EntityModelCodeGenerator</Generator>
<LastGenOutput>TestModel.Designer.cs</LastGenOutput>
- </EntityDeploy>
- <None Include="TestDB.csdl" />
- <None Include="TestDB.msl" />
- <None Include="TestDB.ssdl" />
+ </EmbeddedResource>
+ <EmbeddedResource Include="TestModel.msl" />
+ <EmbeddedResource Include="TestModel.ssdl" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
@@ -111,9 +110,7 @@
</Target>
-->
<PropertyGroup>
- <PreBuildEvent>rem call "$(DevEnvDir)..\Tools\vsvars32.bat"
-rem edmgen /mode:EntityClassGeneration /incsdl:$(ProjectDir)TestDb.csdl /project:TestDB /namespace:MySql.Data.Entity.Tests
-rem move *.cs $(ProjectDir)
+ <PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
Added: trunk/MySql.Data.Entity/Tests/RelationalOperators.cs
===================================================================
--- trunk/MySql.Data.Entity/Tests/RelationalOperators.cs (rev 0)
+++ trunk/MySql.Data.Entity/Tests/RelationalOperators.cs 2009-01-21 17:20:41 UTC (rev 1496)
@@ -0,0 +1,100 @@
+// Copyright (C) 2004-2007 MySQL AB
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation
+//
+// There are special exceptions to the terms and conditions of the GPL
+// as it is applied to this software. View the full text of the
+// exception in file EXCEPTIONS in the directory of this software
+// distribution.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+using System;
+using System.Data;
+using System.Threading;
+using MySql.Data.MySqlClient;
+using MySql.Data.MySqlClient.Tests;
+using System.Data.EntityClient;
+using System.Data.Common;
+using NUnit.Framework;
+using System.Data.Objects;
+
+namespace MySql.Data.Entity.Tests
+{
+ [TestFixture]
+ public class RelationalOperators : BaseEdmTest
+ {
+ public RelationalOperators()
+ : base()
+ {
+ }
+
+ private EntityConnection GetEntityConnection()
+ {
+ string connectionString = String.Format(
+ "metadata=TestDB.csdl|TestDB.msl|TestDB.ssdl;provider=MySql.Data.MySqlClient; provider connection string=\"{0}\"", GetConnectionString(true));
+ EntityConnection connection = new EntityConnection(connectionString);
+ return connection;
+ }
+
+ [Test]
+ public void Except()
+ {
+/* using (TestDB.TestDB db = new TestDB.TestDB())
+ {
+ var q = from c in db.Companies where
+ var query = from o in db.Orders
+ where o.StoreId = 3
+ select o;
+
+ var result = query.First();
+ }*/
+ }
+
+ [Test]
+ public void Intersect()
+ {
+ }
+
+ [Test]
+ public void CrossJoin()
+ {
+ }
+
+ [Test]
+ public void Union()
+ {
+ }
+
+ [Test]
+ public void UnionAll()
+ {
+ using (testEntities context = new testEntities())
+ {
+ MySqlDataAdapter da = new MySqlDataAdapter(
+ "SELECT t.Id FROM Toys t UNION ALL SELECT c.Id FROM Companies c", conn);
+ DataTable dt = new DataTable();
+ da.Fill(dt);
+
+ string entitySQL = @"(SELECT t.Id, t.Name FROM Toys AS t)
+ UNION ALL (SELECT c.Id, c.Name FROM Companies AS c)";
+ ObjectQuery<DbDataRecord> query = context.CreateQuery<DbDataRecord>(entitySQL);
+ int i = 0;
+ foreach (DbDataRecord r in query)
+ {
+ i++;
+ }
+ Assert.AreEqual(dt.Rows.Count, i);
+ }
+ }
+ }
+}
\ No newline at end of file
Deleted: trunk/MySql.Data.Entity/Tests/TestDB.csdl
===================================================================
--- trunk/MySql.Data.Entity/Tests/TestDB.csdl 2009-01-20 20:51:10 UTC (rev 1495)
+++ trunk/MySql.Data.Entity/Tests/TestDB.csdl 2009-01-21 17:20:41 UTC (rev 1496)
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Schema Namespace="TestDB" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2006/04/edm">
-
- <EntityContainer Name="TestDB">
- <EntitySet Name="Employees" EntityType="TestDB.Employees" />
- <EntitySet Name="Children" EntityType="TestDB.Children" />
- <EntitySet Name="Companies" EntityType ="TestDB.Companies"/>
- <EntitySet Name="Toys" EntityType ="TestDB.Toys"/>
- <AssociationSet Name="FK_Toys_Companies" Association ="TestDB.FK_Toys_Companies">
- <End Role="Companies" EntitySet ="Companies"/>
- <End Role="Toys" EntitySet ="Toys"/>
- </AssociationSet>
- <EntitySet Name="Stores" EntityType ="TestDB.Stores"/>
- <EntitySet Name="Orders" EntityType ="TestDB.Orders"/>
- </EntityContainer>
-
- <EntityType Name="Employees">
- <Key>
- <PropertyRef Name="EmployeeId" />
- </Key>
- <Property Name="EmployeeId" Type="Int32" Nullable="false" />
- <Property Name="LastName" Type="String" Nullable="false" MaxLength="20" />
- <Property Name="FirstName" Type="String" Nullable="false" MaxLength="10" />
- <Property Name="Age" Type="Int32" Nullable="true"/>
- </EntityType>
-
- <EntityType Name="SalariedEmployee" BaseType ="TestDB.Employees">
- <Property Name="Salary" Type="Int32" Nullable="false" />
- </EntityType>
-
- <EntityType Name="Children">
- <Key>
- <PropertyRef Name="Id" />
- </Key>
- <Property Name="Id" Type="Int32" Nullable="false" />
- <Property Name="EmployeeID" Type="Int32" Nullable="false" />
- <Property Name="LastName" Type="String" Nullable="false" MaxLength="20" />
- <Property Name="FirstName" Type="String" Nullable="false" MaxLength="10" />
- </EntityType>
-
- <EntityType Name="Companies">
- <Key>
- <PropertyRef Name="Id"/>
- </Key>
- <Property Name="Id" Type="Int32" Nullable ="false"/>
- <Property Name="Name" Type="String" Nullable ="false" MaxLength ="100"/>
- <Property Name="DateBegan" Type="DateTime" Nullable ="true"/>
- <Property Name="NumEmployees" Type="Int32" Nullable ="true"/>
- <Property Name="Address" Type="TestDB.CommonAddress" Nullable="false"/>
- <NavigationProperty Name="Toys" Relationship ="TestDB.FK_Toys_Companies" FromRole ="Companies" ToRole ="Toys"/>
- </EntityType>
-
- <EntityType Name="Toys">
- <Key>
- <PropertyRef Name="Id"/>
- </Key>
- <Property Name="Id" Type="Int32" Nullable ="false"/>
- <Property Name="Name" Type="String" MaxLength="100" Nullable ="false"/>
- <Property Name="MinAge" Type="Int32" Nullable ="false"/>
- <NavigationProperty Name="Companies" Relationship ="TestDB.FK_Toys_Companies" FromRole="Toys" ToRole="Companies"/>
- </EntityType>
-
- <Association Name="FK_Toys_Companies">
- <End Role="Companies" Type="TestDB.Companies" Multiplicity="1" />
- <End Role="Toys" Type="TestDB.Toys" Multiplicity="*" />
- </Association>
-
- <!-- Complex type -->
- <ComplexType Name="CommonAddress" >
- <Property Name ="Address" Type="String" />
- <Property Name ="City" Type="String" />
- <Property Name ="State" Type="String" />
- <Property Name ="ZipCode" Type="String" />
- </ComplexType>
-
- <EntityType Name="Stores">
- <Key>
- <PropertyRef Name="Id"/>
- </Key>
- <Property Name="Id" Type="Int32" Nullable ="false"/>
- <Property Name="Name" Type="String" MaxLength="50" Nullable ="false"/>
- </EntityType>
-
- <EntityType Name="Orders">
- <Key>
- <PropertyRef Name="Id"/>
- </Key>
- <Property Name="Id" Type="Int32" Nullable ="false"/>
- <Property Name="StoreId" Type="Int32" Nullable ="false"/>
- <Property Name="Freight" Type="Double" Nullable ="false"/>
- </EntityType>
-</Schema>
\ No newline at end of file
Deleted: trunk/MySql.Data.Entity/Tests/TestDB.msl
===================================================================
--- trunk/MySql.Data.Entity/Tests/TestDB.msl 2009-01-20 20:51:10 UTC (rev 1495)
+++ trunk/MySql.Data.Entity/Tests/TestDB.msl 2009-01-21 17:20:41 UTC (rev 1496)
@@ -1,105 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Mapping Space="C-S" xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS">
- <EntityContainerMapping StorageEntityContainer="!dbname" CdmEntityContainer="TestDB">
-
-<!-- <EntitySetMapping Name="Employee">
- <EntityTypeMapping TypeName="TestDB.Employee">
- <MappingFragment StoreEntitySet="Employees" >
- <ScalarProperty Name="Id" ColumnName="Id" />
- <ScalarProperty Name="LastName" ColumnName="LastName" />
- <ScalarProperty Name="FirstName" ColumnName="FirstName" />
- </MappingFragment>
- </EntityTypeMapping>
- </EntitySetMapping>-->
-
- <EntitySetMapping Name="Employees">
- <!--
- The IsTypeOf keyword tells the mapping that the following mapping applies to all subtypes of
- the given Type (in this case, InternationalOrder as well as Order)
- -->
- <EntityTypeMapping TypeName="IsTypeOf(TestDB.Employees)">
- <MappingFragment StoreEntitySet="Employees" >
- <ScalarProperty Name="EmployeeId" ColumnName="employeeId" />
- <ScalarProperty Name="LastName" ColumnName="lastName" />
- <ScalarProperty Name="FirstName" ColumnName="firstName" />
- <ScalarProperty Name="Age" ColumnName ="age"/>
- </MappingFragment>
- </EntityTypeMapping>
-
- <EntityTypeMapping TypeName ="TestDB.SalariedEmployee">
- <MappingFragment StoreEntitySet="SalariedEmployees">
- <ScalarProperty Name="EmployeeId" ColumnName="employeeId" />
- <ScalarProperty Name="Salary" ColumnName="salary" />
- </MappingFragment>
- </EntityTypeMapping>
- </EntitySetMapping>
-
-
- <EntitySetMapping Name="Children">
- <EntityTypeMapping TypeName="TestDB.Children">
- <MappingFragment StoreEntitySet="EmployeeChildren" >
- <ScalarProperty Name="Id" ColumnName="Id" />
- <ScalarProperty Name="EmployeeID" ColumnName="EmployeeID" />
- <ScalarProperty Name="LastName" ColumnName="LastName" />
- <ScalarProperty Name="FirstName" ColumnName="FirstName" />
- </MappingFragment>
- </EntityTypeMapping>
- </EntitySetMapping>
-
- <EntitySetMapping Name="Companies">
- <EntityTypeMapping TypeName="IsTypeOf(TestDB.Companies)">
- <MappingFragment StoreEntitySet="Companies" >
- <ScalarProperty Name="Id" ColumnName="Id" />
- <ScalarProperty Name="Name" ColumnName="Name" />
- <ScalarProperty Name="DateBegan" ColumnName="DateBegan" />
- <ScalarProperty Name="NumEmployees" ColumnName="NumEmployees" />
- <ComplexProperty Name ="Address" TypeName ="TestDB.CommonAddress" >
- <ScalarProperty Name="Address" ColumnName="Address" />
- <ScalarProperty Name="City" ColumnName="City" />
- <ScalarProperty Name="State" ColumnName="State" />
- <ScalarProperty Name="ZipCode" ColumnName="ZipCode" />
- </ComplexProperty >
- </MappingFragment>
- </EntityTypeMapping>
- </EntitySetMapping>
-
- <EntitySetMapping Name="Toys">
- <EntityTypeMapping TypeName="IsTypeOf(TestDB.Toys)">
- <MappingFragment StoreEntitySet="Toys" >
- <ScalarProperty Name="Id" ColumnName="Id" />
- <ScalarProperty Name="Name" ColumnName="Name" />
- <ScalarProperty Name="MinAge" ColumnName="MinAge" />
- </MappingFragment>
- </EntityTypeMapping>
- </EntitySetMapping>
-
- <AssociationSetMapping Name="FK_Toys_Companies" TypeName="TestDB.FK_Toys_Companies" StoreEntitySet="Toys">
- <EndProperty Name="Companies">
- <ScalarProperty Name="Id" ColumnName="MakerId" />
- </EndProperty>
- <EndProperty Name="Toys">
- <ScalarProperty Name="Id" ColumnName="Id" />
- </EndProperty>
- </AssociationSetMapping>
-
- <EntitySetMapping Name="Stores">
- <EntityTypeMapping TypeName="IsTypeOf(TestDB.Stores)">
- <MappingFragment StoreEntitySet="Stores" >
- <ScalarProperty Name="Id" ColumnName="Id" />
- <ScalarProperty Name="Name" ColumnName="Name" />
- </MappingFragment>
- </EntityTypeMapping>
- </EntitySetMapping>
-
- <EntitySetMapping Name="Orders">
- <EntityTypeMapping TypeName="IsTypeOf(TestDB.Orders)">
- <MappingFragment StoreEntitySet="Orders" >
- <ScalarProperty Name="Id" ColumnName="Id" />
- <ScalarProperty Name="StoreId" ColumnName="StoreId" />
- <ScalarProperty Name="Freight" ColumnName="Freight" />
- </MappingFragment>
- </EntityTypeMapping>
- </EntitySetMapping>
-
- </EntityContainerMapping>
-</Mapping>
\ No newline at end of file
Deleted: trunk/MySql.Data.Entity/Tests/TestDB.ssdl
===================================================================
--- trunk/MySql.Data.Entity/Tests/TestDB.ssdl 2009-01-20 20:51:10 UTC (rev 1495)
+++ trunk/MySql.Data.Entity/Tests/TestDB.ssdl 2009-01-21 17:20:41 UTC (rev 1496)
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Schema Namespace="TestDB.Store" Alias="Self" Provider="MySql.Data.MySqlClient" ProviderManifestToken="" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
- <EntityContainer Name="!dbname">
- <EntitySet Name="Employees" EntityType="TestDB.Store.Employees" />
- <EntitySet Name="EmployeeChildren" EntityType="TestDB.Store.EmployeeChildren" />
- <EntitySet Name="SalariedEmployees" EntityType ="TestDB.Store.SalariedEmployees"/>
- <EntitySet Name="Toys" EntityType ="TestDB.Store.Toys"/>
- <EntitySet Name="Companies" EntityType ="TestDB.Store.Companies"/>
- <AssociationSet Name="FK_Toys_Companies" Association ="TestDB.Store.FK_Toys_Companies">
- <End Role="Companies" EntitySet ="Companies"/>
- <End Role="Toys" EntitySet ="Toys"/>
- </AssociationSet>
- <EntitySet Name="Stores" EntityType ="TestDB.Store.Stores"/>
- <EntitySet Name="Orders" EntityType ="TestDB.Store.Orders"/>
- </EntityContainer>
-
- <EntityType Name="Employees">
- <Key>
- <PropertyRef Name="employeeId" />
- </Key>
- <Property Name="employeeId" Type="int" Nullable="false"/>
- <Property Name="lastName" Type="nvarchar" Nullable="false" MaxLength="20" />
- <Property Name="firstName" Type="nvarchar" Nullable="false" MaxLength="10" />
- <Property Name="age" Type="int" Nullable="true"/>
- </EntityType>
-
- <EntityType Name="SalariedEmployees" >
- <Key>
- <PropertyRef Name="employeeId" />
- </Key>
- <Property Name="employeeId" Type="int" Nullable="false" />
- <Property Name="salary" Type="int" Nullable="false" />
- </EntityType>
-
- <EntityType Name="EmployeeChildren">
- <Key>
- <PropertyRef Name="Id" />
- </Key>
- <Property Name="Id" Type="int" Nullable="false"/>
- <Property Name="EmployeeID" Type="int" Nullable="false"/>
- <Property Name="LastName" Type="nvarchar" Nullable="false" MaxLength="20" />
- <Property Name="FirstName" Type="nvarchar" Nullable="false" MaxLength="10" />
- </EntityType>
-
- <EntityType Name="Companies">
- <Key>
- <PropertyRef Name="Id"/>
- </Key>
- <Property Name="Id" Type="int" Nullable ="false"/>
- <Property Name="Name" Type="varchar" MaxLength ="100" Nullable ="false"/>
- <Property Name="DateBegan" Type="date" Nullable ="true"/>
- <Property Name="NumEmployees" Type="int" Nullable ="true"/>
- <Property Name ="Address" Type="varchar" MaxLength="50"/>
- <Property Name ="City" Type="varchar" MaxLength ="50"/>
- <Property Name ="State" Type="char" MaxLength ="2" />
- <Property Name ="ZipCode" Type="char" MaxLength ="9"/>
- </EntityType>
-
- <EntityType Name="Toys">
- <Key>
- <PropertyRef Name="Id"/>
- </Key>
- <Property Name="Id" Type="int" Nullable ="false"/>
- <Property Name="Name" Type="varchar" MaxLength="100" Nullable ="false"/>
- <Property Name="MinAge" Type="int" Nullable ="false"/>
- <Property Name="MakerId" Type="int" Nullable ="false"/>
- </EntityType>
-
- <Association Name="FK_Toys_Companies">
- <End Role="Companies" Type="TestDB.Store.Companies" Multiplicity ="1"/>
- <End Role="Toys" Type="TestDB.Store.Toys" Multiplicity ="*"/>
- <ReferentialConstraint>
- <Principal Role="Companies">
- <PropertyRef Name="Id"/>
- </Principal>
- <Dependent Role="Toys">
- <PropertyRef Name="MakerId"/>
- </Dependent>
- </ReferentialConstraint>
- </Association>
-
- <EntityType Name="Stores">
- <Key>
- <PropertyRef Name="Id"/>
- </Key>
- <Property Name="Id" Type="int" Nullable ="false"/>
- <Property Name="Name" Type="varchar" MaxLength="50" Nullable ="false"/>
- </EntityType>
-
- <EntityType Name="Orders">
- <Key>
- <PropertyRef Name="Id"/>
- </Key>
- <Property Name="Id" Type="int" Nullable ="false"/>
- <Property Name="StoreId" Type="int" Nullable ="false"/>
- <Property Name="Freight" Type="double" Nullable ="false"/>
- </EntityType>
-</Schema>
\ No newline at end of file
Copied: trunk/MySql.Data.Entity/Tests/TestModel.csdl (from rev 1493, trunk/MySql.Data.Entity/Tests/TestDB.csdl)
===================================================================
--- trunk/MySql.Data.Entity/Tests/TestModel.csdl (rev 0)
+++ trunk/MySql.Data.Entity/Tests/TestModel.csdl 2009-01-21 17:20:41 UTC (rev 1496)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Schema Namespace="testModel" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2006/04/edm">
+
+ <EntityContainer Name="testEntities">
+ <EntitySet Name="Employees" EntityType="testModel.Employees" />
+ <EntitySet Name="Children" EntityType="testModel.Children" />
+ <EntitySet Name="Companies" EntityType ="testModel.Companies"/>
+ <EntitySet Name="Toys" EntityType ="testModel.Toys"/>
+ <AssociationSet Name="FK_Toys_Companies" Association ="testModel.FK_Toys_Companies">
+ <End Role="Companies" EntitySet ="Companies"/>
+ <End Role="Toys" EntitySet ="Toys"/>
+ </AssociationSet>
+ <EntitySet Name="Stores" EntityType ="testModel.Stores"/>
+ <EntitySet Name="Orders" EntityType ="testModel.Orders"/>
+ </EntityContainer>
+
+ <EntityType Name="Employees">
+ <Key>
+ <PropertyRef Name="EmployeeId" />
+ </Key>
+ <Property Name="EmployeeId" Type="Int32" Nullable="false" />
+ <Property Name="LastName" Type="String" Nullable="false" MaxLength="20" />
+ <Property Name="FirstName" Type="String" Nullable="false" MaxLength="10" />
+ <Property Name="Age" Type="Int32" Nullable="true"/>
+ </EntityType>
+
+ <EntityType Name="SalariedEmployee" BaseType ="testModel.Employees">
+ <Property Name="Salary" Type="Int32" Nullable="false" />
+ </EntityType>
+
+ <EntityType Name="Children">
+ <Key>
+ <PropertyRef Name="Id" />
+ </Key>
+ <Property Name="Id" Type="Int32" Nullable="false" />
+ <Property Name="EmployeeID" Type="Int32" Nullable="false" />
+ <Property Name="LastName" Type="String" Nullable="false" MaxLength="20" />
+ <Property Name="FirstName" Type="String" Nullable="false" MaxLength="10" />
+ </EntityType>
+
+ <EntityType Name="Companies">
+ <Key>
+ <PropertyRef Name="Id"/>
+ </Key>
+ <Property Name="Id" Type="Int32" Nullable ="false"/>
+ <Property Name="Name" Type="String" Nullable ="false" MaxLength ="100"/>
+ <Property Name="DateBegan" Type="DateTime" Nullable ="true"/>
+ <Property Name="NumEmployees" Type="Int32" Nullable ="true"/>
+ <Property Name="Address" Type="testModel.CommonAddress" Nullable="false"/>
+ <NavigationProperty Name="Toys" Relationship ="testModel.FK_Toys_Companies" FromRole ="Companies" ToRole ="Toys"/>
+ </EntityType>
+
+ <EntityType Name="Toys">
+ <Key>
+ <PropertyRef Name="Id"/>
+ </Key>
+ <Property Name="Id" Type="Int32" Nullable ="false"/>
+ <Property Name="Name" Type="String" MaxLength="100" Nullable ="false"/>
+ <Property Name="MinAge" Type="Int32" Nullable ="false"/>
+ <NavigationProperty Name="Companies" Relationship ="testModel.FK_Toys_Companies" FromRole="Toys" ToRole="Companies"/>
+ </EntityType>
+
+ <Association Name="FK_Toys_Companies">
+ <End Role="Companies" Type="testModel.Companies" Multiplicity="1" />
+ <End Role="Toys" Type="testModel.Toys" Multiplicity="*" />
+ </Association>
+
+ <!-- Complex type -->
+ <ComplexType Name="CommonAddress" >
+ <Property Name ="Address" Type="String" />
+ <Property Name ="City" Type="String" />
+ <Property Name ="State" Type="String" />
+ <Property Name ="ZipCode" Type="String" />
+ </ComplexType>
+
+ <EntityType Name="Stores">
+ <Key>
+ <PropertyRef Name="Id"/>
+ </Key>
+ <Property Name="Id" Type="Int32" Nullable ="false"/>
+ <Property Name="Name" Type="String" MaxLength="50" Nullable ="false"/>
+ </EntityType>
+
+ <EntityType Name="Orders">
+ <Key>
+ <PropertyRef Name="Id"/>
+ </Key>
+ <Property Name="Id" Type="Int32" Nullable ="false"/>
+ <Property Name="StoreId" Type="Int32" Nullable ="false"/>
+ <Property Name="Freight" Type="Double" Nullable ="false"/>
+ </EntityType>
+</Schema>
\ No newline at end of file
Deleted: trunk/MySql.Data.Entity/Tests/TestModel.edmx
===================================================================
--- trunk/MySql.Data.Entity/Tests/TestModel.edmx 2009-01-20 20:51:10 UTC (rev 1495)
+++ trunk/MySql.Data.Entity/Tests/TestModel.edmx 2009-01-21 17:20:41 UTC (rev 1496)
@@ -1,134 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
- <!-- EF Runtime content -->
- <edmx:Runtime>
- <!-- SSDL content -->
- <edmx:StorageModels>
- <Schema Namespace="testModel.Store" Alias="Self" Provider="MySql.Data.MySqlClient" ProviderManifestToken="" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
- <EntityContainer Name="testModelStoreContainer">
- <EntitySet Name="Companies" EntityType="testModel.Store.Companies" store:Type="Tables" Schema="dbo" />
- <EntitySet Name="Toys" EntityType="testModel.Store.Toys" store:Type="Tables" Schema="dbo" />
- <AssociationSet Name="FK_Toys_Companies" Association="testModel.Store.FK_Toys_Companies">
- <End Role="Companies" EntitySet="Companies" />
- <End Role="Toys" EntitySet="Toys" />
- </AssociationSet>
- </EntityContainer>
- <EntityType Name="Companies">
- <Key>
- <PropertyRef Name="id" />
- </Key>
- <Property Name="id" Type="int" Nullable="false" />
- <Property Name="name" Type="varchar" Nullable="false" MaxLength="100" />
- </EntityType>
- <EntityType Name="Toys">
- <Key>
- <PropertyRef Name="id" />
- </Key>
- <Property Name="id" Type="int" Nullable="false" />
- <Property Name="name" Type="varchar" MaxLength="20" />
- <Property Name="makerId" Type="int" Nullable="false" />
- </EntityType>
- <Association Name="FK_Toys_Companies">
- <End Role="Companies" Type="testModel.Store.Companies" Multiplicity="1" />
- <End Role="Toys" Type="testModel.Store.Toys" Multiplicity="*" />
- <ReferentialConstraint>
- <Principal Role="Companies">
- <PropertyRef Name="id" />
- </Principal>
- <Dependent Role="Toys">
- <PropertyRef Name="makerId" />
- </Dependent>
- </ReferentialConstraint>
- </Association>
- </Schema>
- </edmx:StorageModels>
- <!-- CSDL content -->
- <edmx:ConceptualModels>
- <Schema Namespace="testModel" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2006/04/edm">
- <EntityContainer Name="testEntities">
- <EntitySet Name="Companies" EntityType="testModel.Companies" />
- <EntitySet Name="Toys" EntityType="testModel.Toys" />
- <AssociationSet Name="FK_Toys_Companies" Association="testModel.FK_Toys_Companies">
- <End Role="Companies" EntitySet="Companies" />
- <End Role="Toys" EntitySet="Toys" />
- </AssociationSet>
- </EntityContainer>
- <EntityType Name="Companies">
- <Key>
- <PropertyRef Name="id" />
- </Key>
- <Property Name="id" Type="Int32" Nullable="false" />
- <Property Name="name" Type="String" Nullable="false" MaxLength="100" Unicode="false" FixedLength="false" />
- <NavigationProperty Name="Toys" Relationship="testModel.FK_Toys_Companies" FromRole="Companies" ToRole="Toys" />
- </EntityType>
- <EntityType Name="Toys">
- <Key>
- <PropertyRef Name="id" />
- </Key>
- <Property Name="id" Type="Int32" Nullable="false" />
- <Property Name="name" Type="String" MaxLength="20" Unicode="false" FixedLength="false" />
- <NavigationProperty Name="Companies" Relationship="testModel.FK_Toys_Companies" FromRole="Toys" ToRole="Companies" />
- </EntityType>
- <Association Name="FK_Toys_Companies">
- <End Role="Companies" Type="testModel.Companies" Multiplicity="1" />
- <End Role="Toys" Type="testModel.Toys" Multiplicity="*" />
- </Association>
- </Schema>
- </edmx:ConceptualModels>
- <!-- C-S mapping content -->
- <edmx:Mappings>
- <Mapping Space="C-S" xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS">
- <EntityContainerMapping StorageEntityContainer="testModelStoreContainer" CdmEntityContainer="testEntities">
- <EntitySetMapping Name="Companies">
- <EntityTypeMapping TypeName="IsTypeOf(testModel.Companies)">
- <MappingFragment StoreEntitySet="Companies">
- <ScalarProperty Name="id" ColumnName="id" />
- <ScalarProperty Name="name" ColumnName="name" />
- </MappingFragment>
- </EntityTypeMapping>
- </EntitySetMapping>
- <EntitySetMapping Name="Toys">
- <EntityTypeMapping TypeName="IsTypeOf(testModel.Toys)">
- <MappingFragment StoreEntitySet="Toys">
- <ScalarProperty Name="id" ColumnName="id" />
- <ScalarProperty Name="name" ColumnName="name" />
- </MappingFragment>
- </EntityTypeMapping>
- </EntitySetMapping>
- <AssociationSetMapping Name="FK_Toys_Companies" TypeName="testModel.FK_Toys_Companies" StoreEntitySet="Toys">
- <EndProperty Name="Companies">
- <ScalarProperty Name="id" ColumnName="makerId" />
- </EndProperty>
- <EndProperty Name="Toys">
- <ScalarProperty Name="id" ColumnName="id" />
- </EndProperty>
- </AssociationSetMapping>
- </EntityContainerMapping>
- </Mapping>
- </edmx:Mappings>
- </edmx:Runtime>
- <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
- <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2007/06/edmx">
- <edmx:Connection>
- <DesignerInfoPropertySet>
- <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
- </DesignerInfoPropertySet>
- </edmx:Connection>
- <edmx:Options>
- <DesignerInfoPropertySet>
- <DesignerProperty Name="ValidateOnBuild" Value="true" />
- </DesignerInfoPropertySet>
- </edmx:Options>
- <!-- Diagram content (shape and connector positions) -->
- <edmx:Diagrams>
- <Diagram Name="TestModel">
- <EntityTypeShape EntityType="testModel.Companies" Width="1.5" PointX="0.75" PointY="0.875" Height="1.59568359375" IsExpanded="true" />
- <EntityTypeShape EntityType="testModel.Toys" Width="1.5" PointX="3" PointY="0.875" Height="1.59568359375" IsExpanded="true" />
- <AssociationConnector Association="testModel.FK_Toys_Companies" ManuallyRouted="false">
- <ConnectorPoint PointX="2.25" PointY="1.672841796875" />
- <ConnectorPoint PointX="3" PointY="1.672841796875" />
- </AssociationConnector>
- </Diagram>
- </edmx:Diagrams>
- </edmx:Designer>
-</edmx:Edmx>
\ No newline at end of file
Copied: trunk/MySql.Data.Entity/Tests/TestModel.msl (from rev 1493, trunk/MySql.Data.Entity/Tests/TestDB.msl)
===================================================================
--- trunk/MySql.Data.Entity/Tests/TestModel.msl (rev 0)
+++ trunk/MySql.Data.Entity/Tests/TestModel.msl 2009-01-21 17:20:41 UTC (rev 1496)
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Mapping Space="C-S" xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS">
+ <EntityContainerMapping StorageEntityContainer="testModelStoreContainer" CdmEntityContainer="testEntities">
+
+<!-- <EntitySetMapping Name="Employee">
+ <EntityTypeMapping TypeName="TestDB.Employee">
+ <MappingFragment StoreEntitySet="Employees" >
+ <ScalarProperty Name="Id" ColumnName="Id" />
+ <ScalarProperty Name="LastName" ColumnName="LastName" />
+ <ScalarProperty Name="FirstName" ColumnName="FirstName" />
+ </MappingFragment>
+ </EntityTypeMapping>
+ </EntitySetMapping>-->
+
+ <EntitySetMapping Name="Employees">
+ <!--
+ The IsTypeOf keyword tells the mapping that the following mapping applies to all subtypes of
+ the given Type (in this case, InternationalOrder as well as Order)
+ -->
+ <EntityTypeMapping TypeName="IsTypeOf(testModel.Employees)">
+ <MappingFragment StoreEntitySet="Employees" >
+ <ScalarProperty Name="EmployeeId" ColumnName="employeeId" />
+ <ScalarProperty Name="LastName" ColumnName="lastName" />
+ <ScalarProperty Name="FirstName" ColumnName="firstName" />
+ <ScalarProperty Name="Age" ColumnName ="age"/>
+ </MappingFragment>
+ </EntityTypeMapping>
+
+ <EntityTypeMapping TypeName ="IsTypeOf(testModel.SalariedEmployee)">
+ <MappingFragment StoreEntitySet="SalariedEmployees">
+ <ScalarProperty Name="EmployeeId" ColumnName="employeeId" />
+ <ScalarProperty Name="Salary" ColumnName="salary" />
+ </MappingFragment>
+ </EntityTypeMapping>
+ </EntitySetMapping>
+
+
+ <EntitySetMapping Name="Children">
+ <EntityTypeMapping TypeName="IsTypeOf(testModel.Children)">
+ <MappingFragment StoreEntitySet="EmployeeChildren" >
+ <ScalarProperty Name="Id" ColumnName="Id" />
+ <ScalarProperty Name="EmployeeID" ColumnName="EmployeeID" />
+ <ScalarProperty Name="LastName" ColumnName="LastName" />
+ <ScalarProperty Name="FirstName" ColumnName="FirstName" />
+ </MappingFragment>
+ </EntityTypeMapping>
+ </EntitySetMapping>
+
+ <EntitySetMapping Name="Companies">
+ <EntityTypeMapping TypeName="IsTypeOf(testModel.Companies)">
+ <MappingFragment StoreEntitySet="Companies" >
+ <ScalarProperty Name="Id" ColumnName="Id" />
+ <ScalarProperty Name="Name" ColumnName="Name" />
+ <ScalarProperty Name="DateBegan" ColumnName="DateBegan" />
+ <ScalarProperty Name="NumEmployees" ColumnName="NumEmployees" />
+ <ComplexProperty Name ="Address" TypeName ="TestDB.CommonAddress" >
+ <ScalarProperty Name="Address" ColumnName="Address" />
+ <ScalarProperty Name="City" ColumnName="City" />
+ <ScalarProperty Name="State" ColumnName="State" />
+ <ScalarProperty Name="ZipCode" ColumnName="ZipCode" />
+ </ComplexProperty >
+ </MappingFragment>
+ </EntityTypeMapping>
+ </EntitySetMapping>
+
+ <EntitySetMapping Name="Toys">
+ <EntityTypeMapping TypeName="IsTypeOf(testModel.Toys)">
+ <MappingFragment StoreEntitySet="Toys" >
+ <ScalarProperty Name="Id" ColumnName="Id" />
+ <ScalarProperty Name="Name" ColumnName="Name" />
+ <ScalarProperty Name="MinAge" ColumnName="MinAge" />
+ </MappingFragment>
+ </EntityTypeMapping>
+ </EntitySetMapping>
+
+ <AssociationSetMapping Name="FK_Toys_Companies" TypeName="testModel.FK_Toys_Companies" StoreEntitySet="Toys">
+ <EndProperty Name="Companies">
+ <ScalarProperty Name="Id" ColumnName="MakerId" />
+ </EndProperty>
+ <EndProperty Name="Toys">
+ <ScalarProperty Name="Id" ColumnName="Id" />
+ </EndProperty>
+ </AssociationSetMapping>
+
+ <EntitySetMapping Name="Stores">
+ <EntityTypeMapping TypeName="IsTypeOf(testModel.Stores)">
+ <MappingFragment StoreEntitySet="Stores" >
+ <ScalarProperty Name="Id" ColumnName="Id" />
+ <ScalarProperty Name="Name" ColumnName="Name" />
+ </MappingFragment>
+ </EntityTypeMapping>
+ </EntitySetMapping>
+
+ <EntitySetMapping Name="Orders">
+ <EntityTypeMapping TypeName="IsTypeOf(testModel.Orders)">
+ <MappingFragment StoreEntitySet="Orders" >
+ <ScalarProperty Name="Id" ColumnName="Id" />
+ <ScalarProperty Name="StoreId" ColumnName="StoreId" />
+ <ScalarProperty Name="Freight" ColumnName="Freight" />
+ </MappingFragment>
+ </EntityTypeMapping>
+ </EntitySetMapping>
+
+ </EntityContainerMapping>
+</Mapping>
\ No newline at end of file
Copied: trunk/MySql.Data.Entity/Tests/TestModel.ssdl (from rev 1493, trunk/MySql.Data.Entity/Tests/TestDB.ssdl)
===================================================================
--- trunk/MySql.Data.Entity/Tests/TestModel.ssdl (rev 0)
+++ trunk/MySql.Data.Entity/Tests/TestModel.ssdl 2009-01-21 17:20:41 UTC (rev 1496)
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Schema Namespace="testModel.Store" Alias="Self" Provider="MySql.Data.MySqlClient" ProviderManifestToken="" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
+ <EntityContainer Name="testModelStoreContainer">
+ <EntitySet Name="Employees" EntityType="testModel.Store.Employees" />
+ <EntitySet Name="EmployeeChildren" EntityType="testModel.Store.EmployeeChildren" />
+ <EntitySet Name="SalariedEmployees" EntityType ="testModel.Store.SalariedEmployees"/>
+ <EntitySet Name="Toys" EntityType ="testModel.Store.Toys"/>
+ <EntitySet Name="Companies" EntityType ="testModel.Store.Companies"/>
+ <AssociationSet Name="FK_Toys_Companies" Association ="testModel.Store.FK_Toys_Companies">
+ <End Role="Companies" EntitySet ="Companies"/>
+ <End Role="Toys" EntitySet ="Toys"/>
+ </AssociationSet>
+ <EntitySet Name="Stores" EntityType ="testModel.Store.Stores"/>
+ <EntitySet Name="Orders" EntityType ="testModel.Store.Orders"/>
+ </EntityContainer>
+
+ <EntityType Name="Employees">
+ <Key>
+ <PropertyRef Name="employeeId" />
+ </Key>
+ <Property Name="employeeId" Type="int" Nullable="false"/>
+ <Property Name="lastName" Type="nvarchar" Nullable="false" MaxLength="20" />
+ <Property Name="firstName" Type="nvarchar" Nullable="false" MaxLength="10" />
+ <Property Name="age" Type="int" Nullable="true"/>
+ </EntityType>
+
+ <EntityType Name="SalariedEmployees" >
+ <Key>
+ <PropertyRef Name="employeeId" />
+ </Key>
+ <Property Name="employeeId" Type="int" Nullable="false" />
+ <Property Name="salary" Type="int" Nullable="false" />
+ </EntityType>
+
+ <EntityType Name="EmployeeChildren">
+ <Key>
+ <PropertyRef Name="Id" />
+ </Key>
+ <Property Name="Id" Type="int" Nullable="false"/>
+ <Property Name="EmployeeID" Type="int" Nullable="false"/>
+ <Property Name="LastName" Type="nvarchar" Nullable="false" MaxLength="20" />
+ <Property Name="FirstName" Type="nvarchar" Nullable="false" MaxLength="10" />
+ </EntityType>
+
+ <EntityType Name="Companies">
+ <Key>
+ <PropertyRef Name="Id"/>
+ </Key>
+ <Property Name="Id" Type="int" Nullable ="false"/>
+ <Property Name="Name" Type="varchar" MaxLength ="100" Nullable ="false"/>
+ <Property Name="DateBegan" Type="date" Nullable ="true"/>
+ <Property Name="NumEmployees" Type="int" Nullable ="true"/>
+ <Property Name ="Address" Type="varchar" MaxLength="50"/>
+ <Property Name ="City" Type="varchar" MaxLength ="50"/>
+ <Property Name ="State" Type="char" MaxLength ="2" />
+ <Property Name ="ZipCode" Type="char" MaxLength ="9"/>
+ </EntityType>
+
+ <EntityType Name="Toys">
+ <Key>
+ <PropertyRef Name="Id"/>
+ </Key>
+ <Property Name="Id" Type="int" Nullable ="false"/>
+ <Property Name="Name" Type="varchar" MaxLength="100" Nullable ="false"/>
+ <Property Name="MinAge" Type="int" Nullable ="false"/>
+ <Property Name="MakerId" Type="int" Nullable ="false"/>
+ </EntityType>
+
+ <Association Name="FK_Toys_Companies">
+ <End Role="Companies" Type="testModel.Store.Companies" Multiplicity ="1"/>
+ <End Role="Toys" Type="testModel.Store.Toys" Multiplicity ="*"/>
+ <ReferentialConstraint>
+ <Principal Role="Companies">
+ <PropertyRef Name="Id"/>
+ </Principal>
+ <Dependent Role="Toys">
+ <PropertyRef Name="MakerId"/>
+ </Dependent>
+ </ReferentialConstraint>
+ </Association>
+
+ <EntityType Name="Stores">
+ <Key>
+ <PropertyRef Name="Id"/>
+ </Key>
+ <Property Name="Id" Type="int" Nullable ="false"/>
+ <Property Name="Name" Type="varchar" MaxLength="50" Nullable ="false"/>
+ </EntityType>
+
+ <EntityType Name="Orders">
+ <Key>
+ <PropertyRef Name="Id"/>
+ </Key>
+ <Property Name="Id" Type="int" Nullable ="false"/>
+ <Property Name="StoreId" Type="int" Nullable ="false"/>
+ <Property Name="Freight" Type="double" Nullable ="false"/>
+ </EntityType>
+</Schema>
\ No newline at end of file
| Thread |
|---|
| • Connector/NET commit: r1496 - in trunk/MySql.Data.Entity: Provider/Generators Provider/Statements Tests | rburnett | 21 Jan |