简体   繁体   中英

“Column not allowed here” in EF6 with TPH and Devart Oracle

When creating my DB schema with EF, Devart dotConnect generates the following SQL for my TPH class:

CREATE TABLE "Types" ( 
  ID NUMBER(10) NOT NULL,
  "Name" NVARCHAR2(50) NULL,
  "Discriminator" NVARCHAR2(128) DEFAULT (Undefined) NULL,
  CONSTRAINT "PK_Types" PRIMARY KEY (ID)
)

I always get a "ORA-00984: column not allowed here" error. Seems quite obvious, it has something to do with 'undefined' in the discriminator column declaration. Is this a bug in dotConnect or did I do something wrong with the mapping? Seems quite a simple case. There are about a dozen classes extending AbstractType, but none of them adds new columns.

My POCO class:

public abstract partial class AbstractType
{
    public int Id { get; set; }

    public string Name { get; set; }
}

Mapping:

public class AbstractTypeMap : EntityTypeConfiguration<AbstractType>
{
    public AbstractTypeMap()
    {
        HasKey(t => t.Id);

        ToTable("Types");
        this.Property(t => t.Name).HasMaxLength(50);

        this.Property(t => t.Id).HasColumnName("ID");
        this.Property(t => t.Name).HasColumnName("Name");
    }
}

I'm using EF 6.1.1, dotConnect Oracle 8.4.171 on a local 11g express install.

我们已经在论坛上回答了您: http : //forums.devart.com/viewtopic.php?f=1&t=29872#p102533

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM