Bug: bad schema with table per concrete type
Posted: Fri 24 Feb 2012 18:15
Table Per Concrete Type strategy does not work - neither mappings nor schema is generated correctly.
Simple example: classes Bar and Baz both extend Foo.
Generate the schema, you get this:
Where's the Foo table schema? If you did not mark class Foo as Abstract=True, it's a concrete class, which means you need a table.
Here's the mapping generated for class Foo:
Discriminator value - what for? There is no discriminator-column for this type of mapping.
Simple example: classes Bar and Baz both extend Foo.
Generate the schema, you get this:
Code: Select all
--
CREATE TABLE dbo.Baz (
Id INT NOT NULL IDENTITY,
Notes VARCHAR(MAX) NOT NULL,
Junk VARCHAR(MAX) NOT NULL,
CONSTRAINT PK_Baz PRIMARY KEY (Id)
)
CREATE TABLE dbo.Bar (
Id INT NOT NULL IDENTITY,
Notes VARCHAR(MAX) NOT NULL,
Stuff VARCHAR(MAX) NOT NULL,
CONSTRAINT PK_Bar PRIMARY KEY (Id)
)
Here's the mapping generated for class Foo:
Code: Select all