Symfony2 and Doctrine – Error: Invalid PathExpression. Must be a StateFieldPathExpression December 29, 2022 by Tarik You can use the currently undocumented IDENTITY function to select the FK IDs in a query: SELECT IDENTITY(c.parent) ...