Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1203

Single Table Inheritance - Discriminator Column is not populated

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: Git Master
    • Fix Version/s: 2.1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      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 { }
      

        Activity

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Johannes Schmitt
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: