mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3369: Association Entity primary key composite with foreign keys #4161
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 4, 2014).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user SayDevNet:
Impossible to make an association between two entities in the following cases:
Entity1 with a composite primary key :
key1 (PK)
key2 (PK)
Entity2 with a composite primary key (with foreign key) :
key1 (PK FK)
key2 (PK FK)
key3 (PK)
How to connect two entities with this scenario?
@doctrinebot commented on GitHub (Nov 5, 2014):
Comment created by @ocramius:
This actually works as long as
key1,key2andkey3are user-generated values (such as UUIDs). We cannot support the case when these values are db-side generated.@doctrinebot commented on GitHub (Nov 5, 2014):
Issue was closed with resolution "Invalid"
@doctrinebot commented on GitHub (Nov 5, 2014):
Comment created by SayDevNet:
Can we get around this problem ?
@maks-rafalko commented on GitHub (Apr 28, 2017):
@Ocramius Actually, this does not work:
And there is explicit condition for this case in
24377156b4/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php (L1485)Should it be reopened?
@maks-rafalko commented on GitHub (Apr 28, 2017):
Found an official answer that this is impossible https://github.com/doctrine/doctrine2/issues/6355#issuecomment-289158628
@lcobucci commented on GitHub (Apr 29, 2017):
@borNfreee thanks for linking to the comment, I'll apply the same tags here.
@maks-rafalko commented on GitHub (Apr 29, 2017):
@lcobucci would you be interested if I provide a documentation PR with noticing about this limitation?
@lcobucci commented on GitHub (Apr 29, 2017):
@borNfreee sure, it would be great!