mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1051: Generated SQL Query Missing Table/Join Constraint leading to SQL Syntax Error #1312
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Feb 28, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user webb.roger:
SELECT u, uc, ur
FROM ARN\EntityBundle\Entity\Users u
INNER JOIN u.contact_info uc
INNER JOIN u.user_roles ur
WHERE u.username = :username
Generates the following SQL Query
SELECT u0_.user_id AS user_id0, u0_.username AS username1, u0_.password AS password2, u0_.contact_info_id AS contact_info_id3, u0_.user_active AS user_active4, u0_.user_date AS user_date5, u0_.office_id AS office_id6, u0_.superuser AS superuser7, c1_.contact_info_id AS contact_info_id8, c1_.first_name AS first_name9, c1_.last_name AS last_name10, c1_.address AS address11, c1_.city_id AS city_id12, c1_.zip AS zip13, c1_.email AS email14, u2_.user_role_id AS user_role_id15, u2_.role AS role16, u0_.contact_info_id AS contact_info_id17, c1_.city_id AS city_id18 FROM users u0_ INNER JOIN contact_info c1_ ON u0_.contact_info_id = c1_.contact_info_id INNER JOIN WHERE u0_.user_id = ?')
Notice the "INNER JOIN WHERE", this is the problem.
The mapping is as follows:
Users->user_roles
UserRoles->user
Let me know if you need any more information. Happy to help. Thanks.
@doctrinebot commented on GitHub (Feb 28, 2011):
Comment created by webb.roger:
Problem was due to a missing "orm:" prefix for symfony annotations. Thanks.
@doctrinebot commented on GitHub (Feb 28, 2011):
Issue was closed with resolution "Invalid"