DDC-1818: ResultSetMapping::addJoinedEntityResult does not work #2291

Closed
opened 2026-01-22 13:47:29 +01:00 by admin · 7 comments
Owner

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

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user nikola.petkanski:

I'm trying to fetch the data for oneToMany relation, but it failed:

{quote}
Notice: Undefined index: SomeCompany\SomeBundle\Entity\SomeJoinedEntity in ..../symfony/vendor/doctrine/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 382
{quote}

While trying to debug the issue I came to the conclusion that if I use the FQDN entity name it works, but if using SomeBundle:SomeJoinedEntity does not. I also checked the unit tests and I wasn't able to find which test this behavior - they all use the FQDN and not the short name of the entity.

I wasn't sure whether this should be a Symfony 2.0.13 issue or a Doctrine2 one, but in the end I've the intention that it has to be posted here.

Originally created by @doctrinebot on GitHub (May 10, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user nikola.petkanski: I'm trying to fetch the data for oneToMany relation, but it failed: {quote} Notice: Undefined index: SomeCompany\SomeBundle\Entity\SomeJoinedEntity in ..../symfony/vendor/doctrine/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 382 {quote} While trying to debug the issue I came to the conclusion that if I use the FQDN entity name it works, but if using SomeBundle:SomeJoinedEntity does not. I also checked the unit tests and I wasn't able to find which test this behavior - they all use the FQDN and not the short name of the entity. I wasn't sure whether this should be a Symfony 2.0.13 issue or a Doctrine2 one, but in the end I've the intention that it has to be posted here.
admin added the Bug label 2026-01-22 13:47:29 +01:00
admin closed this issue 2026-01-22 13:47:29 +01:00
Author
Owner

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

Comment created by @beberlei:

Its probably a usage problem. ResultSetMapping are used internally in Doctrine as well and they work there. Check Doctrine\ORM\Query\SQLWalker .php on how to use addJoinedentityResult with one-to-many associations. you probably have to set meta columns aswell.

@doctrinebot commented on GitHub (May 11, 2012): Comment created by @beberlei: Its probably a usage problem. ResultSetMapping are used internally in Doctrine as well and they work there. Check Doctrine\ORM\Query\SQLWalker .php on how to use addJoinedentityResult with one-to-many associations. you probably have to set meta columns aswell.
Author
Owner

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

Comment created by dante77:

I support Nikolas opinion that is a bug. With a simple 1:N (one to many) relation, using FQDNs for the entities involved works, where as the shorthand form SomeBundle:Entity does not (for the same, unaltered native query).
IMHO, the hydrating behaviour should be the same for FQDNs and shorthand entity names, but it is obviously not.

@doctrinebot commented on GitHub (Jul 17, 2012): Comment created by dante77: I support Nikolas opinion that is a bug. With a simple 1:N (one to many) relation, using FQDNs for the entities involved works, where as the shorthand form SomeBundle:Entity does not (for the same, unaltered native query). IMHO, the hydrating behaviour should be the same for FQDNs and shorthand entity names, but it is obviously not.
Author
Owner

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

Comment created by @beberlei:

Just reading that part now, yes the shorthand does not work here, and can never work.

@doctrinebot commented on GitHub (Jul 17, 2012): Comment created by @beberlei: Just reading that part now, yes the shorthand does not work here, and can never work.
Author
Owner

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

Comment created by nikola.petkanski:

Is it going to be fixed?

@doctrinebot commented on GitHub (Jul 17, 2012): Comment created by nikola.petkanski: Is it going to be fixed?
Author
Owner

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

Comment created by @beberlei:

no, its not easy to fix it in ResultSetMapping without opening a can of worms.

@doctrinebot commented on GitHub (Jul 17, 2012): Comment created by @beberlei: no, its not easy to fix it in ResultSetMapping without opening a can of worms.
Author
Owner

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

Issue was closed with resolution "Invalid"

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

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

Comment created by nikola.petkanski:

Shouldn't this issue be marked as known instead of closed? It has to be fixed at some point, perhaps at the next major refactoring :)

@doctrinebot commented on GitHub (Jul 17, 2012): Comment created by nikola.petkanski: Shouldn't this issue be marked as known instead of closed? It has to be fixed at some point, perhaps at the next major refactoring :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2291