mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1648: Primary Keys as Foreign Keys - still not working in Reverse Engineering in 2.1.6 #2073
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 12, 2012).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user rivaros:
Please, read this old thread - looks like this problem still is not solved :(
http://comments.gmane.org/gmane.comp.php.symfony.symfony2/1398
As I understand it is supported in the "core", but some reverse engineer script is still not using that possibility.
Could you at least point where this can fixed?
@doctrinebot commented on GitHub (Feb 12, 2012):
Comment created by @beberlei:
In lib/Doctrine/ORM/Mapping/DatabaseDriver.php
@doctrinebot commented on GitHub (Feb 12, 2012):
Comment created by rivaros:
Thank you Benjamin,
Actually started tracking this error from /lib/Doctrine/ORM/Mapping/ClasMetadataInfo.php and step-bystep it goes to
/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php
Actually it calls ClasMetadataInfo::mapMayToOne instead of mapOneToOne in such situations.
Will investigate further. Pff... DatabaseDriver.php looks a hard class. :)
@doctrinebot commented on GitHub (Feb 12, 2012):
Comment created by rivaros:
I am almost done with it - need a little more help from you:
So I fixed the DatabaseDriver so it correctly calls mapOneToOne
and passes association_mapping to it.
this gives the following structure
Now the problem: in my entity I got the following
So it correctly created a One-To-One mapping, but it did not preserve @Id attribute.
I guess this is because field_associations and mapping_associations are processed in separate way,
and in mapping_association it ignores the $mapping["id"] setting.
Do you know what code is managing creating the <id ....> / @Id staff - it is common for annotation/yaml/xml, e.x. when i generated xml for entity, it also does not contain tag.
@doctrinebot commented on GitHub (Feb 12, 2012):
Comment created by rivaros:
Update: fixed the last problem in Doctrine/ORM/Tools/EntityGenerator.php
Still has to be fixed in YAML/XML exporters - not very familiar with the syntax.
@doctrinebot commented on GitHub (Mar 3, 2012):
Comment created by @beberlei:
This PR fixes the problem https://github.com/doctrine/doctrine2/pull/280
@doctrinebot commented on GitHub (Mar 14, 2012):
Comment created by @beberlei:
Fixed
@doctrinebot commented on GitHub (Mar 14, 2012):
Issue was closed with resolution "Fixed"