mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-891: DDC-117: No sequence generation with composite foreign key #1105
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 25, 2010).
Jira issue originally created by user felicitus:
Given the following entity definitions, Doctrine does not attempt to manage generated values. For example, in MySQL, it is perfectly possible to create a composite primary key and set auto_increment on one of these. See below the code for issues that occur.
The first issue which occurs is that Doctrine does not generate the field "id" within PhoneNumber set to auto_increment.
The second issue which occurs is that Doctrine becomes confused when inserting a new record into PhoneNumber, because of the following INSERT INTO statement:
@doctrinebot commented on GitHub (Nov 25, 2010):
Comment created by romanb:
I don't think this will ever be possible.
@doctrinebot commented on GitHub (Nov 25, 2010):
Comment created by felicitus:
Is there a technical reason for that? I mean, with DDC-117 we are aiming for composite foreign keys, or is DDC-117 cancelled?
@doctrinebot commented on GitHub (Nov 25, 2010):
Comment created by @beberlei:
A composite key is ALWAYS of the type "ASSIGNED" and cannot be a combination of different id generation strategies.
You could however write a prePersist Listener that does this for you.
@doctrinebot commented on GitHub (Nov 25, 2010):
Comment created by felicitus:
Okay, maybe this is a feature for 3.0 or so. However, I'd suggest leaving this bug open as this is something which needs to be documented once DDC-117 becomes integrated within the main branch.
Additionally, Doctrine should complain about different ID generation strategies. Right now it silently ignores it.