Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1201

DQL Example about count(*) related entity is wrong

    Details

    • Type: Documentation Documentation
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.1
    • Fix Version/s: None
    • Component/s: Documentation
    • Security Level: All
    • Labels:
      None

      Description

      DQL Example about count related entity is wrong

        Activity

        Benjamin Eberlei created issue -
        Hide
        Aigars Gedroics added a comment -

        Also similar DQL in documentation URL http://www.doctrine-project.org/docs/orm/2.1/en/reference/dql-doctrine-query-language.html#pure-and-mixed-results fails parsing stage:

        $dql = "SELECT u, 'some scalar string', count(u.groups) AS num FROM User u JOIN u.groups g GROUP BY u.id";
        

        with error

          [Doctrine\ORM\Query\QueryException]                                                                                                                         
          [Semantical Error] line 0, col 40 near 'localizations)': Error: Invalid PathExpression. StateFieldPathExpression or SingleValuedAssociationField expected. 
        

        Should be "count(g.id)" instead of "count(u.groups)".

        Show
        Aigars Gedroics added a comment - Also similar DQL in documentation URL http://www.doctrine-project.org/docs/orm/2.1/en/reference/dql-doctrine-query-language.html#pure-and-mixed-results fails parsing stage: $dql = "SELECT u, 'some scalar string', count(u.groups) AS num FROM User u JOIN u.groups g GROUP BY u.id" ; with error [Doctrine\ORM\Query\QueryException] [Semantical Error] line 0, col 40 near 'localizations)': Error: Invalid PathExpression. StateFieldPathExpression or SingleValuedAssociationField expected. Should be "count(g.id)" instead of "count(u.groups)".
        Aigars Gedroics made changes -
        Field Original Value New Value
        Affects Version/s 2.1.1 [ 10153 ]
        Component/s Documentation [ 10013 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 12706 ] jira-feedback [ 13934 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 13934 ] jira-feedback2 [ 15798 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15798 ] jira-feedback3 [ 18055 ]

        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-1201, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

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

            Dates

            • Created:
              Updated: