Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-111

Trouble with MappedSuperclass/Single collection inheritance and commit 2e8071a4dc68b027f969

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Invalid
    • Affects Version/s: 1.0.0BETA2
    • Fix Version/s: 1.0.0BETA2
    • Component/s: None
    • Labels:
      None

      Description

      I have the following classes :

      @MappedSuperClass
      @InheritanceType("SINGLE_COLLECTION")
      @DiscriminatorField(fieldName="_class")
      @DiscriminatorMap(

      {"SuperClass"="SuperClass", "SubClass1"="SubClass1", "SubClass2"="SubClass2"}

      )
      abstract class SuperClass {}

      @Document
      class SubClass1 extends SuperClass {}

      @MappedSuperClass
      abstract class SuperClass2 extends SuperClass {}

      @Document
      abstract class SubClass2 extends SuperClass2 {}

      SubClass2 does not use the single collection.
      SubClass1 and SubClass2 do not use the discriminator map.

      This broke after commit 2e8071a4dc68b027f969.

      Why can't we use MappedSuperclasses in an single collection inheritance strategy ?

        Activity

        Hide
        JF Bustarret added a comment -

        Dropped MappedSuperClasses and switched to Document classes.

        I'm not very happy to have abstract classes configured as Document, but it works.

        Show
        JF Bustarret added a comment - Dropped MappedSuperClasses and switched to Document classes. I'm not very happy to have abstract classes configured as Document, but it works.
        Hide
        Jonathan H. Wage added a comment -

        Hi, can you make a test case for this exposing the problem?

        Show
        Jonathan H. Wage added a comment - Hi, can you make a test case for this exposing the problem?
        Hide
        Jonathan H. Wage added a comment -

        Ok, a mapped super class is not the top of the inheritance hierarchy. The first class that extends the mapped super class is where you would define that inheritance information.

        Show
        Jonathan H. Wage added a comment - Ok, a mapped super class is not the top of the inheritance hierarchy. The first class that extends the mapped super class is where you would define that inheritance information.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            JF Bustarret
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: