mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 15:02:22 +01:00
DDC-992: ManyToMany self referencing association bug with lazy loading #1237
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 (Jan 19, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user vigor_bg:
Hi there I encountered a bug. When was trying to get ManyToMany self referencing association via lazy loading.
Here is my Entity.
When I call
The SQL that is generated is :
In the last SQL query there is a mistake in the where clause it should be RoleRelations.roleID = ? and not t0.roleID = ?. And because of that it is not returning correct result.
@doctrinebot commented on GitHub (Jan 19, 2011):
Comment created by vigor_bg:
The solution that I found is in the class BasicEntityPersister on line 1123 we have
and i replace it with
I am not sure if that is the correct answer but as far as i have tested it doesn't mess up with the normal many to many association via join table.
@doctrinebot commented on GitHub (Jan 23, 2011):
Comment created by @beberlei:
There is a simple workaround if you rename the "roleID" from the join table to something else, childRoleID for example. This should work for now. I am looking into a way to fix this issue.
@doctrinebot commented on GitHub (Jan 23, 2011):
Comment created by vigor_bg:
Ok thanks :)
@doctrinebot commented on GitHub (Mar 20, 2011):
Comment created by @beberlei:
Fixed, merged into 2.0.x branch.
@doctrinebot commented on GitHub (Mar 20, 2011):
Issue was closed with resolution "Fixed"