DDC-152: Polymorphic queries and fields of subclasses #188

Closed
opened 2026-01-22 12:30:02 +01:00 by admin · 1 comment
Owner

Originally created by @doctrinebot on GitHub (Nov 16, 2009).

Jira issue originally created by user romanb:

Currently fields of subclasses are added to the ResultSetMapping under the alias of the queried (parent) class. Later during hydration if the queried (parent) class does not own a field AbstractHydrator#_lookupDeclaringClass looks up the first subclass that defines a field with that name. However, multiple subclasses can define a field with the same name, so this is error-prone.

Fields of subclasses in a polymorphic query should probably be added to the ResultSetMapping with their own alias. The lookup during hydration should be removed and the information which field belongs to which class encoded in the ResultSetMapping.

Originally created by @doctrinebot on GitHub (Nov 16, 2009). Jira issue originally created by user romanb: Currently fields of subclasses are added to the ResultSetMapping under the alias of the queried (parent) class. Later during hydration if the queried (parent) class does not own a field AbstractHydrator#_lookupDeclaringClass looks up the first subclass that defines a field with that name. However, multiple subclasses can define a field with the same name, so this is error-prone. Fields of subclasses in a polymorphic query should probably be added to the ResultSetMapping with their own alias. The lookup during hydration should be removed and the information which field belongs to which class encoded in the ResultSetMapping.
admin added the Bug label 2026-01-22 12:30:02 +01:00
admin closed this issue 2026-01-22 12:30:03 +01:00
Author
Owner

@doctrinebot commented on GitHub (Dec 19, 2009):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Dec 19, 2009): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#188