Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1204

Single Table Inheritance - Columns of one hierarchy are dropped

    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

      In the following example, the columns of the classes B, C, D are not in the database schema. Only those of the classes A and E.

      /**
       * @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",
       *     "e"   = "E"
       * })
       */
      abstract class A { }
      
      /**
       * @ORM\Entity
       */
      abstract class B extends A { }
      
      /**
       * @ORM\Entity
       */
      class C extends B { }
      
      /**
       * @ORM\Entity
       */
      class D extends B { }
      
      /**
       * @ORM\Entity
       */
      class E extends A { }
      

        Activity

        Hide
        Johannes Schmitt added a comment -

        The problem here is that class B is not part of the discriminator map which was necessary due to issue #DDC-1203. So, once that is resolved this can likely be closed as well.

        Show
        Johannes Schmitt added a comment - The problem here is that class B is not part of the discriminator map which was necessary due to issue # DDC-1203 . So, once that is resolved this can likely be closed as well.
        Hide
        Benjamin Eberlei added a comment -

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed

          People

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

            Dates

            • Created:
              Updated:
              Resolved: