Skip to content

DDC-1203: Single Table Inheritance - Discriminator Column is not populated #1809

@doctrinebot

Description

@doctrinebot

Jira issue originally created by user johannes:

I have the following class inheritance; if I have the mapped super class in there, the discriminator column is not populated; if I remove it, it is correctly set.

/****
 * @ORM\Entity
 * @ORM\Table(name = "a")
 * @ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
 * @ORM\InheritanceType("SINGLE_TABLE")
 * @ORM\DiscriminatorColumn(name="type", type="string", length=20)
 * @ORM\DiscriminatorMap({
 *     "c"   = "C",
 *     "d"   = "D"
 * })
 */
abstract class A { }

/****
 * @ORM\MappedSuperClass
 */
abstract class B extends A { }

/****
 * @ORM\Entity
 */
class C extends B { }

/****
 * @ORM\Entity
 */
class D extends B { }

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions