Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1163

entity persister gets superclasses' metadata for proxied subclass entity

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 2.0.4, 2.0.5
    • Fix Version/s: 2.0.6, 2.1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      PHP 5.3.6 on Debian Lenny & WinXP, PostgreSQL 8.4 & SQLite 3

      Description

      Using class table inheritance:

      When a proxy for a subclass-entity is registered at the unit of work and another entity, which references that entities' superclass, is added or removed, the employed entity persister gets/uses the superclasses' metadata.

      If the change-set of the referenced entity contains fields only defined in the subclass, the persister will create bogus SQL because it has no column names or data types: UPDATE table SET = ? WHERE id = ?

      The attached test case is stand-alone, creating an SQLite in-memory DB (sorry, I'm not familiar with your test suite).

      Only the path to Doctrine must be adapted at the top of 'run_test.php'.
      The file 'SubclassPropertyBugTest.php' also contains a more detailed description.

        Activity

        Stan Imbt created issue -
        Stan Imbt made changes -
        Field Original Value New Value
        Description Using class table inheritance:

        When a proxy for a subclass-entity is registered at the unit of work and another entity, which references that entities' superclass, is added or removed, the employed entity persister gets/uses the superclasses' metadata.

        If the change-set of the referenced entity contains fields only defined in the subclass, the persister will create bogus SQL because it has no column names or data types: {{ UPDATE table SET = ? WHERE id = ? }}


        The attached test case is stand-alone, creating an SQLite in-memory DB (sorry, I'm not familiar with your test suite).

        Only the path to Doctrine must be adapted at the top of 'run_test.php'.
        The file 'SubclassPropertyBugTest.php' also contains a more detailed description.
        Using class table inheritance:

        When a proxy for a subclass-entity is registered at the unit of work and another entity, which references that entities' superclass, is added or removed, the employed entity persister gets/uses the superclasses' metadata.

        If the change-set of the referenced entity contains fields only defined in the subclass, the persister will create bogus SQL because it has no column names or data types: {{UPDATE table SET = ? WHERE id = ?}}


        The attached test case is stand-alone, creating an SQLite in-memory DB (sorry, I'm not familiar with your test suite).

        Only the path to Doctrine must be adapted at the top of 'run_test.php'.
        The file 'SubclassPropertyBugTest.php' also contains a more detailed description.
        Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.6 [ 10140 ]
        Fix Version/s 2.1 [ 10022 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 12656 ] jira-feedback [ 14869 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14869 ] jira-feedback2 [ 16733 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 16733 ] jira-feedback3 [ 18986 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Stan Imbt
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: