#At file:///D:/Users/jcasalt/Dev/connector-net/features/bug60652/ based on revid:julio.casal@stripped1040-tb2xe71ivywjf58a
893 Julio Casal 2011-05-26
Modified EFMySqlDataReader to read byte[] values as booleans when the server incorrectly reports bits as binaries when they are members of internal EF UNIONS (MySQL bug #60652, Oracle bug #12593193).
modified:
CHANGES
MySql.Data.Entity/Provider/EFMySqlDataReader.cs
MySql.Data.Entity/Tests/Properties/schema.sql
MySql.Data.Entity/Tests/RelationalOperators.cs
MySql.Data.Entity/Tests/TestModel.Designer.cs
MySql.Data.Entity/Tests/TestModel.edmx
=== modified file 'CHANGES'
--- a/CHANGES 2011-05-25 21:10:40 +0000
+++ b/CHANGES 2011-05-26 14:24:02 +0000
@@ -44,6 +44,8 @@
- Fixed MembershipProvider to only return exact matches when calling GetUser(string username) and
GetUserNameByEmail (MySQL bug #61027, Oracle bug #12562287).
- added the ability to raise a join on the right side of a join to a derived table in EF code generation
+- Modified EFMySqlDataReader to read byte[] values as booleans when the server incorrectly reports bits as binaries
+ when they are members of internal EF UNIONS (MySQL bug #60652, Oracle bug #12593193).
Version 6.1.5
- Fix authorization popup after modifying stored procedure in VS (Bug #44715)
=== modified file 'MySql.Data.Entity/Provider/EFMySqlDataReader.cs'
--- a/MySql.Data.Entity/Provider/EFMySqlDataReader.cs 2010-12-09 03:35:41 +0000
+++ b/MySql.Data.Entity/Provider/EFMySqlDataReader.cs 2011-05-26 14:24:02 +0000
@@ -91,7 +91,15 @@ namespace MySql.Data.Entity
public override bool GetBoolean(int ordinal)
{
- return reader.GetBoolean(ordinal);
+ object value = reader.GetValue(ordinal);
+ bool boolValue;
+
+ if (value.GetType() != typeof(bool))
+ boolValue = (bool)ChangeType(value, typeof(bool));
+ else
+ boolValue = (bool)value;
+
+ return boolValue;
}
public override byte GetByte(int ordinal)
=== modified file 'MySql.Data.Entity/Tests/Properties/schema.sql'
--- a/MySql.Data.Entity/Tests/Properties/schema.sql 2009-11-03 16:10:05 +0000
+++ b/MySql.Data.Entity/Tests/Properties/schema.sql 2011-05-26 14:24:02 +0000
@@ -9,6 +9,10 @@ DROP TABLE IF EXISTS Books;
DROP TABLE IF EXISTS Authors;
DROP TABLE IF EXISTS Publishers;
DROP TABLE IF EXISTS DataTypeTests;
+DROP TABLE IF EXISTS DesktopComputers;
+DROP TABLE IF EXISTS LaptopComputers;
+DROP TABLE IF EXISTS TabletComputers;
+DROP TABLE IF EXISTS Computers;
CREATE TABLE Employees(
Id INT NOT NULL PRIMARY KEY,
@@ -76,6 +80,53 @@ INSERT INTO Toys VALUES (2, 2, 'Rubiks C
INSERT INTO Toys VALUES (3, 1, 'Lincoln Logs', 3);
INSERT INTO Toys VALUES (4, 4, 'Legos', 4);
+CREATE TABLE Computers (
+ `Id` INT NOT NULL AUTO_INCREMENT,
+ `Brand` varchar(100) NOT NULL,
+ CONSTRAINT PK_Computers PRIMARY KEY (Id)) ENGINE=InnoDB;
+
+INSERT INTO Computers VALUES (1, 'Dell');
+INSERT INTO Computers VALUES (2, 'Acer');
+INSERT INTO Computers VALUES (3, 'Toshiba');
+INSERT INTO Computers VALUES (4, 'Sony');
+INSERT INTO Computers VALUES (5, 'Apple');
+INSERT INTO Computers VALUES (6, 'HP');
+
+CREATE TABLE DesktopComputers (
+ `IdDesktopComputer` INT NOT NULL ,
+ `Color` VARCHAR(15) NULL DEFAULT NULL ,
+ PRIMARY KEY (`IdDesktopComputer`) ,
+ CONSTRAINT FK_DesktopComputer_Computer
+ FOREIGN KEY (IdDesktopComputer)
+ REFERENCES Computers (Id)) ENGINE = InnoDB;
+
+INSERT INTO DesktopComputers VALUES (1, 'White');
+INSERT INTO DesktopComputers VALUES (2, 'Black');
+
+CREATE TABLE LaptopComputers (
+ `IdLaptopComputer` INT NOT NULL ,
+ `Size` VARCHAR(45) NULL DEFAULT NULL ,
+ `IsCertified` BIT(1) NULL DEFAULT NULL ,
+ PRIMARY KEY (IdLaptopComputer) ,
+ CONSTRAINT FK_LaptopComputer_Computer
+ FOREIGN KEY (IdLaptopComputer)
+ REFERENCES Computers(Id)) ENGINE = InnoDB;
+
+INSERT INTO LaptopComputers VALUES (3, '13.2 x 9.4', 1);
+INSERT INTO LaptopComputers VALUES (4, '19.5 x 13', 0);
+
+CREATE TABLE TabletComputers (
+ `IdTabletComputer` INT NOT NULL ,
+ `IsAvailable` BIT(1) NULL DEFAULT NULL ,
+ `ReleaseDate` DATETIME NULL DEFAULT NULL ,
+ PRIMARY KEY (IdTabletComputer) ,
+ CONSTRAINT FK_TabletComputer_Computer
+ FOREIGN KEY (IdTabletComputer)
+ REFERENCES Computers(Id)) ENGINE = InnoDB;
+
+INSERT INTO TabletComputers VALUES (5, 1, '2011-05-04');
+INSERT INTO TabletComputers VALUES (6, 1, '2010-06-09');
+
CREATE TABLE Stores (
id INT PRIMARY KEY,
`name` VARCHAR(50) NOT NULL,
=== modified file 'MySql.Data.Entity/Tests/RelationalOperators.cs'
--- a/MySql.Data.Entity/Tests/RelationalOperators.cs 2011-03-03 17:57:57 +0000
+++ b/MySql.Data.Entity/Tests/RelationalOperators.cs 2011-05-26 14:24:02 +0000
@@ -30,6 +30,7 @@ using System.Data.Common;
using NUnit.Framework;
using System.Data.Objects;
using MySql.Data.Entity.Tests.Properties;
+using System.Linq;
namespace MySql.Data.Entity.Tests
{
@@ -90,5 +91,28 @@ namespace MySql.Data.Entity.Tests
Assert.AreEqual(dt.Rows.Count, i);
}
}
+
+ /// <summary>
+ /// Bug #60652 Query returns BLOB type but no BLOBs are in the database.
+ /// </summary>
+ [Test]
+ public void UnionAllWithBitColumnsDoesNotThrow()
+ {
+ using (testEntities entities = new testEntities())
+ {
+ // Here, Computer is the base type of DesktopComputer, LaptopComputer and TabletComputer.
+ // LaptopComputer and TabletComputer include the bit fields that would provoke
+ // an InvalidCastException (byte[] to bool) when participating in a UNION
+ // created internally by the Connector/Net entity framework provider.
+ var computers = from c in entities.Computers
+ select c;
+
+ foreach (Computer computer in computers)
+ {
+ Assert.NotNull(computer);
+ Assert.IsTrue(computer.Id > 0);
+ }
+ }
+ }
}
}
\ No newline at end of file
=== modified file 'MySql.Data.Entity/Tests/TestModel.Designer.cs'
--- a/MySql.Data.Entity/Tests/TestModel.Designer.cs 2010-02-11 22:06:22 +0000
+++ b/MySql.Data.Entity/Tests/TestModel.Designer.cs 2011-05-26 14:24:02 +0000
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:2.0.50727.4927
+// Runtime Version:2.0.50727.5444
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -15,7 +15,7 @@ //-----------------------------------
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("testModel", "FK_Books_Publishers", "Publishers", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(MySql.Data.Entity.Tests.Publisher), "Books", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(MySql.Data.Entity.Tests.Book))]
// Original file name:
-// Generation date: 2/11/2010 3:53:16 PM
+// Generation date: 5/26/2011 9:15:03 AM
namespace MySql.Data.Entity.Tests
{
@@ -200,6 +200,21 @@ namespace MySql.Data.Entity.Tests
}
private global::System.Data.Objects.ObjectQuery<DataTypeTest> _DataTypeTests;
/// <summary>
+ /// There are no comments for Computers in the schema.
+ /// </summary>
+ public global::System.Data.Objects.ObjectQuery<Computer> Computers
+ {
+ get
+ {
+ if ((this._Computers == null))
+ {
+ this._Computers = base.CreateQuery<Computer>("[Computers]");
+ }
+ return this._Computers;
+ }
+ }
+ private global::System.Data.Objects.ObjectQuery<Computer> _Computers;
+ /// <summary>
/// There are no comments for Employees in the schema.
/// </summary>
public void AddToEmployees(Employee employee)
@@ -269,6 +284,13 @@ namespace MySql.Data.Entity.Tests
{
base.AddObject("DataTypeTests", dataTypeTest);
}
+ /// <summary>
+ /// There are no comments for Computers in the schema.
+ /// </summary>
+ public void AddToComputers(Computer computer)
+ {
+ base.AddObject("Computers", computer);
+ }
}
/// <summary>
/// There are no comments for testModel.Employee in the schema.
@@ -1769,4 +1791,252 @@ namespace MySql.Data.Entity.Tests
partial void OnidAsCharChanging(string value);
partial void OnidAsCharChanged();
}
+ /// <summary>
+ /// There are no comments for testModel.Computer in the schema.
+ /// </summary>
+ /// <KeyProperties>
+ /// Id
+ /// </KeyProperties>
+ [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="testModel", Name="Computer")]
+ [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
+ [global::System.Serializable()]
+ [global::System.Runtime.Serialization.KnownTypeAttribute(typeof(global::MySql.Data.Entity.Tests.DesktopComputer))]
+ [global::System.Runtime.Serialization.KnownTypeAttribute(typeof(global::MySql.Data.Entity.Tests.LaptopComputer))]
+ [global::System.Runtime.Serialization.KnownTypeAttribute(typeof(global::MySql.Data.Entity.Tests.TabletComputer))]
+ public abstract partial class Computer : global::System.Data.Objects.DataClasses.EntityObject
+ {
+ /// <summary>
+ /// There are no comments for Property Brand in the schema.
+ /// </summary>
+ [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
+ [global::System.Runtime.Serialization.DataMemberAttribute()]
+ public string Brand
+ {
+ get
+ {
+ return this._Brand;
+ }
+ set
+ {
+ this.OnBrandChanging(value);
+ this.ReportPropertyChanging("Brand");
+ this._Brand = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, false);
+ this.ReportPropertyChanged("Brand");
+ this.OnBrandChanged();
+ }
+ }
+ private string _Brand;
+ partial void OnBrandChanging(string value);
+ partial void OnBrandChanged();
+ /// <summary>
+ /// There are no comments for Property Id in the schema.
+ /// </summary>
+ [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
+ [global::System.Runtime.Serialization.DataMemberAttribute()]
+ public int Id
+ {
+ get
+ {
+ return this._Id;
+ }
+ set
+ {
+ this.OnIdChanging(value);
+ this.ReportPropertyChanging("Id");
+ this._Id = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
+ this.ReportPropertyChanged("Id");
+ this.OnIdChanged();
+ }
+ }
+ private int _Id;
+ partial void OnIdChanging(int value);
+ partial void OnIdChanged();
+ }
+ /// <summary>
+ /// There are no comments for testModel.DesktopComputer in the schema.
+ /// </summary>
+ /// <KeyProperties>
+ /// Id
+ /// </KeyProperties>
+ [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="testModel", Name="DesktopComputer")]
+ [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
+ [global::System.Serializable()]
+ public partial class DesktopComputer : Computer
+ {
+ /// <summary>
+ /// Create a new DesktopComputer object.
+ /// </summary>
+ /// <param name="brand">Initial value of Brand.</param>
+ /// <param name="id">Initial value of Id.</param>
+ public static DesktopComputer CreateDesktopComputer(string brand, int id)
+ {
+ DesktopComputer desktopComputer = new DesktopComputer();
+ desktopComputer.Brand = brand;
+ desktopComputer.Id = id;
+ return desktopComputer;
+ }
+ /// <summary>
+ /// There are no comments for Property Color in the schema.
+ /// </summary>
+ [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
+ [global::System.Runtime.Serialization.DataMemberAttribute()]
+ public string Color
+ {
+ get
+ {
+ return this._Color;
+ }
+ set
+ {
+ this.OnColorChanging(value);
+ this.ReportPropertyChanging("Color");
+ this._Color = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
+ this.ReportPropertyChanged("Color");
+ this.OnColorChanged();
+ }
+ }
+ private string _Color;
+ partial void OnColorChanging(string value);
+ partial void OnColorChanged();
+ }
+ /// <summary>
+ /// There are no comments for testModel.LaptopComputer in the schema.
+ /// </summary>
+ /// <KeyProperties>
+ /// Id
+ /// </KeyProperties>
+ [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="testModel", Name="LaptopComputer")]
+ [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
+ [global::System.Serializable()]
+ public partial class LaptopComputer : Computer
+ {
+ /// <summary>
+ /// Create a new LaptopComputer object.
+ /// </summary>
+ /// <param name="brand">Initial value of Brand.</param>
+ /// <param name="id">Initial value of Id.</param>
+ public static LaptopComputer CreateLaptopComputer(string brand, int id)
+ {
+ LaptopComputer laptopComputer = new LaptopComputer();
+ laptopComputer.Brand = brand;
+ laptopComputer.Id = id;
+ return laptopComputer;
+ }
+ /// <summary>
+ /// There are no comments for Property IsCertified in the schema.
+ /// </summary>
+ [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
+ [global::System.Runtime.Serialization.DataMemberAttribute()]
+ public global::System.Nullable<bool> IsCertified
+ {
+ get
+ {
+ return this._IsCertified;
+ }
+ set
+ {
+ this.OnIsCertifiedChanging(value);
+ this.ReportPropertyChanging("IsCertified");
+ this._IsCertified = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
+ this.ReportPropertyChanged("IsCertified");
+ this.OnIsCertifiedChanged();
+ }
+ }
+ private global::System.Nullable<bool> _IsCertified;
+ partial void OnIsCertifiedChanging(global::System.Nullable<bool> value);
+ partial void OnIsCertifiedChanged();
+ /// <summary>
+ /// There are no comments for Property Size in the schema.
+ /// </summary>
+ [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
+ [global::System.Runtime.Serialization.DataMemberAttribute()]
+ public string Size
+ {
+ get
+ {
+ return this._Size;
+ }
+ set
+ {
+ this.OnSizeChanging(value);
+ this.ReportPropertyChanging("Size");
+ this._Size = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
+ this.ReportPropertyChanged("Size");
+ this.OnSizeChanged();
+ }
+ }
+ private string _Size;
+ partial void OnSizeChanging(string value);
+ partial void OnSizeChanged();
+ }
+ /// <summary>
+ /// There are no comments for testModel.TabletComputer in the schema.
+ /// </summary>
+ /// <KeyProperties>
+ /// Id
+ /// </KeyProperties>
+ [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="testModel", Name="TabletComputer")]
+ [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
+ [global::System.Serializable()]
+ public partial class TabletComputer : Computer
+ {
+ /// <summary>
+ /// Create a new TabletComputer object.
+ /// </summary>
+ /// <param name="brand">Initial value of Brand.</param>
+ /// <param name="id">Initial value of Id.</param>
+ public static TabletComputer CreateTabletComputer(string brand, int id)
+ {
+ TabletComputer tabletComputer = new TabletComputer();
+ tabletComputer.Brand = brand;
+ tabletComputer.Id = id;
+ return tabletComputer;
+ }
+ /// <summary>
+ /// There are no comments for Property IsAvailable in the schema.
+ /// </summary>
+ [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
+ [global::System.Runtime.Serialization.DataMemberAttribute()]
+ public global::System.Nullable<bool> IsAvailable
+ {
+ get
+ {
+ return this._IsAvailable;
+ }
+ set
+ {
+ this.OnIsAvailableChanging(value);
+ this.ReportPropertyChanging("IsAvailable");
+ this._IsAvailable = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
+ this.ReportPropertyChanged("IsAvailable");
+ this.OnIsAvailableChanged();
+ }
+ }
+ private global::System.Nullable<bool> _IsAvailable;
+ partial void OnIsAvailableChanging(global::System.Nullable<bool> value);
+ partial void OnIsAvailableChanged();
+ /// <summary>
+ /// There are no comments for Property ReleaseDate in the schema.
+ /// </summary>
+ [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
+ [global::System.Runtime.Serialization.DataMemberAttribute()]
+ public global::System.Nullable<global::System.DateTime> ReleaseDate
+ {
+ get
+ {
+ return this._ReleaseDate;
+ }
+ set
+ {
+ this.OnReleaseDateChanging(value);
+ this.ReportPropertyChanging("ReleaseDate");
+ this._ReleaseDate = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
+ this.ReportPropertyChanged("ReleaseDate");
+ this.OnReleaseDateChanged();
+ }
+ }
+ private global::System.Nullable<global::System.DateTime> _ReleaseDate;
+ partial void OnReleaseDateChanging(global::System.Nullable<global::System.DateTime> value);
+ partial void OnReleaseDateChanged();
+ }
}
=== modified file 'MySql.Data.Entity/Tests/TestModel.edmx'
--- a/MySql.Data.Entity/Tests/TestModel.edmx 2010-02-11 21:55:20 +0000
+++ b/MySql.Data.Entity/Tests/TestModel.edmx 2011-05-26 14:24:02 +0000
@@ -33,6 +33,22 @@ <?xml version="1.0" encoding="utf-8"?
<End Role="Books" EntitySet="Books" />
</AssociationSet>
<EntitySet Name="DataTypeTests" EntityType="testModel.Store.DataTypeTests"/>
+ <EntitySet Name="Computers" EntityType="testModel.Store.Computers" />
+ <EntitySet Name="DesktopComputers" EntityType="testModel.Store.DesktopComputers" />
+ <EntitySet Name="LaptopComputers" EntityType="testModel.Store.LaptopComputers" />
+ <EntitySet Name="TabletComputers" EntityType="testModel.Store.TabletComputers" />
+ <AssociationSet Name="FK_DesktopComputer_Computer" Association="testModel.Store.FK_DesktopComputer_Computer">
+ <End Role="Computers" EntitySet="Computers" />
+ <End Role="DesktopComputers" EntitySet="DesktopComputers" />
+ </AssociationSet>
+ <AssociationSet Name="FK_LaptopComputer_Computer" Association="testModel.Store.FK_LaptopComputer_Computer">
+ <End Role="Computers" EntitySet="Computers" />
+ <End Role="LaptopComputers" EntitySet="LaptopComputers" />
+ </AssociationSet>
+ <AssociationSet Name="FK_TabletComputer_Computer" Association="testModel.Store.FK_TabletComputer_Computer">
+ <End Role="Computers" EntitySet="Computers" />
+ <End Role="TabletComputers" EntitySet="TabletComputers" />
+ </AssociationSet>
</EntityContainer>
<EntityType Name="Employees">
@@ -218,6 +234,72 @@ <?xml version="1.0" encoding="utf-8"?
<Property Name="id2" Type="guid" Nullable ="false"/>
<Property Name="idAsChar" Type="varchar" MaxLength="36" Nullable="true"/>
</EntityType>
+ <EntityType Name="Computers">
+ <Key>
+ <PropertyRef Name="Id" />
+ </Key>
+ <Property Name="Brand" Type="varchar" Nullable="false" MaxLength="100" />
+ <Property Name="Id" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
+ </EntityType>
+ <EntityType Name="DesktopComputers">
+ <Key>
+ <PropertyRef Name="IdDesktopComputer" />
+ </Key>
+ <Property Name="Color" Type="varchar" MaxLength="15" />
+ <Property Name="IdDesktopComputer" Type="int" Nullable="false" />
+ </EntityType>
+ <EntityType Name="LaptopComputers">
+ <Key>
+ <PropertyRef Name="IdLaptopComputer" />
+ </Key>
+ <Property Name="IdLaptopComputer" Type="int" Nullable="false" />
+ <Property Name="IsCertified" Type="bit" />
+ <Property Name="Size" Type="varchar" MaxLength="45" />
+ </EntityType>
+ <EntityType Name="TabletComputers">
+ <Key>
+ <PropertyRef Name="IdTabletComputer" />
+ </Key>
+ <Property Name="IdTabletComputer" Type="int" Nullable="false" />
+ <Property Name="IsAvailable" Type="bit" />
+ <Property Name="ReleaseDate" Type="datetime" />
+ </EntityType>
+ <Association Name="FK_DesktopComputer_Computer">
+ <End Role="Computers" Type="testModel.Store.Computers" Multiplicity="1" />
+ <End Role="DesktopComputers" Type="testModel.Store.DesktopComputers" Multiplicity="0..1" />
+ <ReferentialConstraint>
+ <Principal Role="Computers">
+ <PropertyRef Name="Id" />
+ </Principal>
+ <Dependent Role="DesktopComputers">
+ <PropertyRef Name="IdDesktopComputer" />
+ </Dependent>
+ </ReferentialConstraint>
+ </Association>
+ <Association Name="FK_LaptopComputer_Computer">
+ <End Role="Computers" Type="testModel.Store.Computers" Multiplicity="1" />
+ <End Role="LaptopComputers" Type="testModel.Store.LaptopComputers" Multiplicity="0..1" />
+ <ReferentialConstraint>
+ <Principal Role="Computers">
+ <PropertyRef Name="Id" />
+ </Principal>
+ <Dependent Role="LaptopComputers">
+ <PropertyRef Name="IdLaptopComputer" />
+ </Dependent>
+ </ReferentialConstraint>
+ </Association>
+ <Association Name="FK_TabletComputer_Computer">
+ <End Role="Computers" Type="testModel.Store.Computers" Multiplicity="1" />
+ <End Role="TabletComputers" Type="testModel.Store.TabletComputers" Multiplicity="0..1" />
+ <ReferentialConstraint>
+ <Principal Role="Computers">
+ <PropertyRef Name="Id" />
+ </Principal>
+ <Dependent Role="TabletComputers">
+ <PropertyRef Name="IdTabletComputer" />
+ </Dependent>
+ </ReferentialConstraint>
+ </Association>
</Schema>
</edmx:StorageModels>
@@ -251,6 +333,7 @@ <?xml version="1.0" encoding="utf-8"?
<End Role="Books" EntitySet="Books" />
</AssociationSet>
<EntitySet Name="DataTypeTests" EntityType="testModel.DataTypeTest"/>
+ <EntitySet Name="Computers" EntityType="testModel.Computer" />
</EntityContainer>
<EntityType Name="Employee">
@@ -388,6 +471,28 @@ <?xml version="1.0" encoding="utf-8"?
<Property Name="id2" Type="Guid" Nullable ="false"/>
<Property Name="idAsChar" Type="String" Nullable="true"/>
</EntityType>
+
+ <EntityType Name="Computer" Abstract="true">
+ <Key>
+ <PropertyRef Name="Id" />
+ </Key>
+ <Property Name="Brand" Type="String" Nullable="false" />
+ <Property Name="Id" Type="Int32" Nullable="false" />
+ </EntityType>
+
+ <EntityType Name="DesktopComputer" BaseType="testModel.Computer">
+ <Property Name="Color" Type="String" />
+ </EntityType>
+
+ <EntityType Name="LaptopComputer" BaseType="testModel.Computer">
+ <Property Name="IsCertified" Type="Boolean" />
+ <Property Name="Size" Type="String" />
+ </EntityType>
+
+ <EntityType Name="TabletComputer" BaseType="testModel.Computer">
+ <Property Name="IsAvailable" Type="Boolean" />
+ <Property Name="ReleaseDate" Type="DateTime" />
+ </EntityType>
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
@@ -581,6 +686,35 @@ <?xml version="1.0" encoding="utf-8"?
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
+
+ <EntitySetMapping Name="Computers">
+ <EntityTypeMapping TypeName="IsTypeOf(testModel.Computer)">
+ <MappingFragment StoreEntitySet="Computers">
+ <ScalarProperty Name="Brand" ColumnName="Brand" />
+ <ScalarProperty Name="Id" ColumnName="Id" />
+ </MappingFragment>
+ </EntityTypeMapping>
+ <EntityTypeMapping TypeName="IsTypeOf(testModel.DesktopComputer)">
+ <MappingFragment StoreEntitySet="DesktopComputers">
+ <ScalarProperty Name="Id" ColumnName="IdDesktopComputer" />
+ <ScalarProperty Name="Color" ColumnName="Color" />
+ </MappingFragment>
+ </EntityTypeMapping>
+ <EntityTypeMapping TypeName="IsTypeOf(testModel.LaptopComputer)">
+ <MappingFragment StoreEntitySet="LaptopComputers">
+ <ScalarProperty Name="Id" ColumnName="IdLaptopComputer" />
+ <ScalarProperty Name="IsCertified" ColumnName="IsCertified" />
+ <ScalarProperty Name="Size" ColumnName="Size" />
+ </MappingFragment>
+ </EntityTypeMapping>
+ <EntityTypeMapping TypeName="IsTypeOf(testModel.TabletComputer)">
+ <MappingFragment StoreEntitySet="TabletComputers">
+ <ScalarProperty Name="Id" ColumnName="IdTabletComputer" />
+ <ScalarProperty Name="IsAvailable" ColumnName="IsAvailable" />
+ <ScalarProperty Name="ReleaseDate" ColumnName="ReleaseDate" />
+ </MappingFragment>
+ </EntityTypeMapping>
+ </EntitySetMapping>
</EntityContainerMapping>
</Mapping>
Attachment: [text/bzr-bundle] bzr/julio.casal@oracle.com-20110526142402-1o3h8zmp5c27fnm5.bundle
| Thread |
|---|
| • bzr commit into connector-net-6.1 branch (julio.casal:893) Bug#60652Bug#12593193 | Julio Casal | 26 May |