DDC-2338 Added failing test for composite foreign key persistance #605

wants to merge 1 commit into


None yet

5 participants


I've added this test regarding ticket DDC-2338

@alex88 alex88 DDC-2338 Added failing test for composite foreign key persistance


thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:


Doctrine member

This is a limitation already known by Doctrine.
The exception that is raised is descriptive on what needs to be done.

Entity of type Doctrine\Tests\ORM\Functional\Ticket\DDC2338FooBar has identity through a foreign entity Doctrine\Tests\ORM\Functional\Ticket\DDC2338Foo, however this entity has no identity itself. You have to call EntityManager#persist() on the related entity and make sure that an identifier was generated before trying to persist 'Doctrine\Tests\ORM\Functional\Ticket\DDC2338FooBar'. In case of Post Insert ID Generation (such as MySQL Auto-Increment or PostgreSQL SERIAL) this means you have to call EntityManager#flush() between both persist operations.

I'll still keep this ticket opened because I found a strange behavior by using @Id column as something else than "id" that I want to investigate.


Year has passed.

@alex88 Is this still relevant?

Doctrine member

Closing. As per discussion with @goetas in #1184, this problem only affects post-insert ID generators (mysql) and it's a limitation that cannot be fixed for now.

@Ocramius Ocramius closed this Nov 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment