Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2495

Partial objects not working with STI

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.4
    • Fix Version/s: None
    • Component/s: ORM
    • Labels:
    • Environment:
      Symfony2 project, Doctrine ORM with MySQL database backend

      Description

      When I try to create a query retrieving partial objects of a root class in single table inheritance hierarchy, the resulting SQL includes all fields from the whole class hierarchy.

      DQL:
      SELECT partial v.

      {id, setupDate, flipDate}

      FROM VIB\FliesBundle\Entity\Vial v WHERE v.id IN (1,2,3,4,5,6,7,8,9,10)

      SQL:
      SELECT v0_.setupDate AS setupDate0, v0_.flipDate AS flipDate1, v0_.id AS id2, v0_.type AS type3, v0_.parent_id AS parent_id4, v0_.position_id AS position_id5, v0_.prevPosition_id AS prevPosition_id6, v0_.incubator_id AS incubator_id7, v0_.stock_id AS stock_id8, v0_.male_id AS male_id9, v0_.virgin_id AS virgin_id10, v0_.targetStock_id AS targetStock_id11, v0_.targetStockVial_id AS targetStockVial_id12 FROM Vial v0_ WHERE (v0_.id IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) AND v0_.type IN ('vial', 'stock', 'cross', 'injection')

      1. CrossVial.php
        12 kB
        Radoslaw Ejsmont
      2. Entity.php
        1 kB
        Radoslaw Ejsmont
      3. InjectionVial.php
        12 kB
        Radoslaw Ejsmont
      4. Stock.php
        7 kB
        Radoslaw Ejsmont
      5. StockVial.php
        3 kB
        Radoslaw Ejsmont
      6. Vial.php
        15 kB
        Radoslaw Ejsmont

        Activity

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Radoslaw Ejsmont
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: