mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-163: Not unique alias error when using the same manyToMany relation from two entity with different alias #201
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 (Nov 20, 2009).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user rickdt:
I think the sample sql speak for himself ...
Error :
DQL :
SQL (mysql):
@doctrinebot commented on GitHub (Nov 20, 2009):
Comment created by rickdt:
In the previous example, please note the "fna_fna_user" intersection table who have the same alias.
@doctrinebot commented on GitHub (Feb 3, 2010):
Comment created by @beberlei:
Hello Eric,
its very hard to get from here to a test-case that can reproduce the issue, also given that the naming is very confusing for somebody not into the specifics of your domain.
Can you try to set-up a simple phpunit test a reproduce case? You can take a hint at trunk/libs/Doctrine/Tests/ORM/Functional/Ticket/DDC*.php how they can be organized easily.
@doctrinebot commented on GitHub (Feb 3, 2010):
Comment created by rickdt:
I would be happy to create you a test case.
I may not have what is needed in current Tests Models available. Do you know a Model entity which correspond to the following pattern :
I need 2 entity (Entity1 and Entity2)
Between both entity, there is two OneToOne relation with different meaning.
Entity1.entity2_relation1 -> entity2
Entity1.entity2_relation2 -> entity2
Ex: Company and Contact
Company.employee -> Contact
Company.manager -> Contact
@doctrinebot commented on GitHub (Feb 3, 2010):
Comment created by rickdt:
I will try o use the CompanyPerson entity
@doctrinebot commented on GitHub (Feb 3, 2010):
Comment created by rickdt:
Here is the test case.
@doctrinebot commented on GitHub (Feb 3, 2010):
Comment created by @beberlei:
Thank you very much. I will look into it tonight.
For The Ticket test-cases we normally create entities lying in the same Ticket Test file and name them Ticket163* to generate a specific re-produce case. However its much better with one of the existing models of course, because its easier to grasp :-)
@doctrinebot commented on GitHub (Feb 7, 2010):
Comment created by @beberlei:
Fixed
@doctrinebot commented on GitHub (Feb 7, 2010):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 1 attachments from Jira into https://gist.github.com/24eafcfa1f84be9e6374