Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2794

the Paginator does not support arbitrary join

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Git Master, 2.3.4, 2.4.1
    • Fix Version/s: 2.5
    • Component/s: Tools
    • Security Level: All
    • Labels:

      Description

      Using the following query with the paginator fails:

      SELECT u
      FROM User u
      JOIN Message m WITH m.author = u
      WHERE m.status = 'draft' -- a condition justifying the join
      

      The CountWalker and the CountOutputWalker both throw a exception saying "Cannot count query which selects two FROM components, cannot make distinction"

      This message is wrong (I can make distinction here. Only User is selected in the result set) and confusing (I spent some time finding the second FROM before figuring it was related to the use of an arbitrary join instead of an association join).

        Issue Links

          Activity

          Christophe Coevoet created issue -
          Hide
          Pierre-Antoine Pinel added a comment - - edited

          Hi,

          I have the same issue.

          My query is : SELECT entity FROM W\XBundle\Entity\X entity LEFT JOIN Z\YBundle\Entity\Y y WITH y.x = entity LEFT JOIN y.v v WHERE v.name LIKE :like

          Is there a way to fix this issue ? I really need this to work with the Paginator.

          Best,

          Show
          Pierre-Antoine Pinel added a comment - - edited Hi, I have the same issue. My query is : SELECT entity FROM W\XBundle\Entity\X entity LEFT JOIN Z\YBundle\Entity\Y y WITH y.x = entity LEFT JOIN y.v v WHERE v.name LIKE :like Is there a way to fix this issue ? I really need this to work with the Paginator. Best,
          Pierre-Antoine Pinel made changes -
          Field Original Value New Value
          Status Open [ 1 ] Awaiting Feedback [ 10000 ]
          Hide
          Christophe Coevoet added a comment -

          Why changing the status to "Awaiting feedback" ? It is not waiting for a feedback of the reporter to check the fix. It is an open ticket which does not have a fix yet

          Show
          Christophe Coevoet added a comment - Why changing the status to "Awaiting feedback" ? It is not waiting for a feedback of the reporter to check the fix. It is an open ticket which does not have a fix yet
          Benjamin Eberlei made changes -
          Status Awaiting Feedback [ 10000 ] Open [ 1 ]
          Marco Pivetta made changes -
          Remote Link This issue links to "Merge commit (Web Link)" [ 10064 ]
          Marco Pivetta made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Benjamin Eberlei [ beberlei ] Marco Pivetta [ ocramius ]
          Fix Version/s 2.5 [ 10522 ]
          Resolution Fixed [ 1 ]
          Marco Pivetta made changes -
          Link This issue depends on DDC-3233 [ DDC-3233 ]
          Hide
          Glen Ainscow added a comment -

          Is this going to be back-ported to 2.4.x?

          Show
          Glen Ainscow added a comment - Is this going to be back-ported to 2.4.x?
          Hide
          Marco Pivetta added a comment -

          No, this is actually a new supported feature: I'm changing the issue type.

          Show
          Marco Pivetta added a comment - No, this is actually a new supported feature: I'm changing the issue type.
          Marco Pivetta made changes -
          Issue Type Bug [ 1 ] Improvement [ 4 ]

          This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

          • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2794, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

            People

            • Assignee:
              Marco Pivetta
              Reporter:
              Christophe Coevoet
            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: