[PR #11397] Fix eager fetch composite foreign key #12998

Closed
opened 2026-01-22 16:15:50 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/11397

State: closed
Merged: Yes


I think https://github.com/doctrine/orm/pull/11289 did not completely fix problem for eager fetch.
Change in that PR checked if primary key of target class is composite but that does not matter when loading collection by foreign key.
It should check if foreign key on target class is composite.

Fix from that PR did not work for me because i had entity with regular autogenerated id (single column), but foreign key referenced entity with composite primary key, like SecondLevelWithoutCompositePrimaryKey in this PR.

Checking if foreign key is composite fixed the problem for me.

**Original Pull Request:** https://github.com/doctrine/orm/pull/11397 **State:** closed **Merged:** Yes --- I think https://github.com/doctrine/orm/pull/11289 did not completely fix problem for eager fetch. Change in that PR checked if primary key of target class is composite but that does not matter when loading collection by foreign key. It should check if foreign key on target class is composite. Fix from that PR did not work for me because i had entity with regular autogenerated id (single column), but foreign key referenced entity with composite primary key, like `SecondLevelWithoutCompositePrimaryKey` in this PR. Checking if foreign key is composite fixed the problem for me.
admin added the pull-request label 2026-01-22 16:15:50 +01:00
admin closed this issue 2026-01-22 16:15:50 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#12998