[DDC-2383] Foreign relations on primary keys don't work on more than two entities (like Foo<>Bar<>Baz) Created: 01/Apr/13 Updated: 14/Apr/13 Resolved: 14/Apr/13
|Project:||Doctrine 2 - ORM|
|Affects Version/s:||2.3, 2.4|
|Reporter:||Jacek Jędrzejewski||Assignee:||Benjamin Eberlei|
|Labels:||hydration, mapping, relations|
I'm trying to accomplish something like this:
For two entities (Foo<>Bar) it works as expected but adding another entity related to Bar (so it's Foo<>Bar<>Baz) ends up with this error:
This error appears when there are some records in the database and I want to query for example all Foos.
My entites look like this:
And fails on
|Comment by Jacek Jędrzejewski [ 01/Apr/13 ]|
Attaching a test case which results in two exceptions - while creating the schema and while fetching entities.
|Comment by Benjamin Eberlei [ 14/Apr/13 ]|
This is sadly a restriction of the foreign keys as primary key feature.
Due to the architecture of shared nothing Metadata instances we cannot validate this at mapping compile time, only at runtime, thus leading to this error.