DDC-1842: [GH-359] Hydrator hotfix - parent object association #2323

Closed
opened 2026-01-22 13:48:27 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (May 27, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user @beberlei:

This issue is created automatically through a Github pull request on behalf of splitin2:

Url: https://github.com/doctrine/doctrine2/pull/359

Message:

Found that using a mixed sql and more than 2 entities the hydrator skips one related association and inserts the third related entity wrongly.

In the case below "c" will be inserted into "a"

SELECT SUM(a.sold) as total, a, b, c FROM Entity\A a LEFT JOIN a.test1 b LEFT JOIN b.test2 c GROUP BY a.id

On a later flush call this will result in ORM\Exception

Found entity of type Entity\A on association Entity\C#test2, but expecting Entity\B
Originally created by @doctrinebot on GitHub (May 27, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user @beberlei: This issue is created automatically through a Github pull request on behalf of splitin2: Url: https://github.com/doctrine/doctrine2/pull/359 Message: Found that using a mixed sql and more than 2 entities the hydrator skips one related association and inserts the third related entity wrongly. In the case below "c" will be inserted into "a" <code>SELECT SUM(a.sold) as total, a, b, c FROM Entity\A a LEFT JOIN a.test1 b LEFT JOIN b.test2 c GROUP BY a.id</code> On a later flush call this will result in ORM\Exception <pre> Found entity of type Entity\A on association Entity\C#test2, but expecting Entity\B </pre>
admin added the Bug label 2026-01-22 13:48:27 +01:00
admin closed this issue 2026-01-22 13:48:28 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 28, 2012):

Comment created by @beberlei:

A related Github Pull-Request [GH-359] was closed
https://github.com/doctrine/doctrine2/pull/359

@doctrinebot commented on GitHub (May 28, 2012): Comment created by @beberlei: A related Github Pull-Request [GH-359] was closed https://github.com/doctrine/doctrine2/pull/359
Author
Owner

@doctrinebot commented on GitHub (Jul 4, 2012):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Jul 4, 2012): Issue was closed with resolution "Invalid"
Author
Owner

@doctrinebot commented on GitHub (Sep 8, 2013):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-359] was closed:
https://github.com/doctrine/dbal/pull/359

@doctrinebot commented on GitHub (Sep 8, 2013): Comment created by @doctrinebot: A related Github Pull-Request [GH-359] was closed: https://github.com/doctrine/dbal/pull/359
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2323