Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1013

Possible issue with multiple levels of Mappedsuperclasses and wrong sql table aliases

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.2
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      Possible issue with multiple levels of Mappedsuperclasses and wrong sql table aliases

        Issue Links

          Activity

          Hide
          Kevin Bond added a comment -

          Any update on this, is there a work-around?

          Show
          Kevin Bond added a comment - Any update on this, is there a work-around?
          Hide
          Benjamin Eberlei added a comment -

          I could not reproduce this yet, can you provide me with a reproduce case?

          Show
          Benjamin Eberlei added a comment - I could not reproduce this yet, can you provide me with a reproduce case?
          Hide
          Kevin Bond added a comment - - edited

          https://gist.github.com/1107578 shows my entity inheritance structure:

          Entity (MappedSuperClass) -> Page -> BaseClassification (MappedSuperClass) -> Species

          ...>getRepository('Species')>findOneByPath('path') gives me this error:

          SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.path' in 'where clause'

          The query being generated is as follows:

          'SELECT t1.body AS body2, t1.path AS path3, t1.id AS id4, t1.title AS title5, t1.updated_at AS updated_at6, t1.created_at AS created_at7, t1.alternate_names AS alternate_names8, t1.latin_name AS latin_name9, t1.genus_id AS genus_id10 FROM species t1 WHERE t0.path = ?'

          that t0 is an alias that does exist.

          If you need further information, let me know.

          Thanks.

          Show
          Kevin Bond added a comment - - edited https://gist.github.com/1107578 shows my entity inheritance structure: Entity (MappedSuperClass) -> Page -> BaseClassification (MappedSuperClass) -> Species ... >getRepository('Species') >findOneByPath('path') gives me this error: SQLSTATE [42S22] : Column not found: 1054 Unknown column 't0.path' in 'where clause' The query being generated is as follows: 'SELECT t1.body AS body2, t1.path AS path3, t1.id AS id4, t1.title AS title5, t1.updated_at AS updated_at6, t1.created_at AS created_at7, t1.alternate_names AS alternate_names8, t1.latin_name AS latin_name9, t1.genus_id AS genus_id10 FROM species t1 WHERE t0.path = ?' that t0 is an alias that does exist. If you need further information, let me know. Thanks.
          Hide
          Guilherme Blanco added a comment -

          Hi,

          Your mapping is wrong.
          Species entity extends from BaseClassification, which contains no "path" field. The only "path" that exists is in Page entity, which has nothing hierarchically to Species entity.

          Marking this issue as invalid. Reopen if you after your mapping fix the issue still persist.

          Cheers,

          Show
          Guilherme Blanco added a comment - Hi, Your mapping is wrong. Species entity extends from BaseClassification, which contains no "path" field. The only "path" that exists is in Page entity, which has nothing hierarchically to Species entity. Marking this issue as invalid. Reopen if you after your mapping fix the issue still persist. Cheers,
          Hide
          Kevin Bond added a comment -

          Hmm, not sure what you mean? BaseClassification extends the Page entity... Should BaseClassification not contain all the fields from Page and Species not all the fields from BaseClassification?

          Show
          Kevin Bond added a comment - Hmm, not sure what you mean? BaseClassification extends the Page entity... Should BaseClassification not contain all the fields from Page and Species not all the fields from BaseClassification?

            People

            • Assignee:
              Guilherme Blanco
              Reporter:
              Benjamin Eberlei
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: