Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-624

Partial object query that leaves out an association to avoid loading it fetches the association anyway.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0-BETA1
    • Fix Version/s: 2.x
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      Assuming:

      Customer <onetoone> Cart

      where Cart is the owning side.

      Since the association from Customer to Cart can not be lazy, it would make sense to leave out the association in a query to avoid loading the carts like this:

      select partial c.{id,name, ... anything except cart} from Customer c"
      

      But this is ignored and the carts of all customers are fetched anyway. Query::HINT_FORCE_PARTIAL_LOAD is an alternative solution, however it has the disadvantage that it disables lazy-loading for all queried objects. If partial querying would honor associations this would allow more fine-grained control.

        Issue Links

          Activity

            People

            • Assignee:
              Guilherme Blanco
              Reporter:
              Roman S. Borschel
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: