DDC-2781: [GH-841] Enable saving native queries using ResultSetMappingBuilder. #3479

Closed
opened 2026-01-22 14:20:38 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 7, 2013).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user @doctrinebot:

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

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

Message:

At present, a useful feature of ResultSetMappingBuilder, which creates the SELECT clause relevant to the built result set mapping, is unusable with named native queries.

This feature adds two additional, optional parameters to named native queries which stores an arbitrary string placeholder and an array of table aliases with the query.

Upon creation of the named native query, if the ResultSetMapping is a ResultSetMappingBuilder, and the placeholder is specified, the arbitrary string specified as the placeholder will be replaced with the output of ResultSetMappingBuilder::generateSelectClause(), passed the table aliases.

This allows native queries to be bootstrapped into an application as named queries, while also allowing the select clause to be automatically updated in the query as the metadata for the mapped entities changes.

Because native queries are not parsed in any way, a string placeholder is required to be able to interpolate the select clause into the query.

Originally created by @doctrinebot on GitHub (Nov 7, 2013). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user @doctrinebot: This issue is created automatically through a Github pull request on behalf of TheFrozenFire: Url: https://github.com/doctrine/doctrine2/pull/841 Message: At present, a useful feature of ResultSetMappingBuilder, which creates the SELECT clause relevant to the built result set mapping, is unusable with named native queries. This feature adds two additional, optional parameters to named native queries which stores an arbitrary string placeholder and an array of table aliases with the query. Upon creation of the named native query, if the ResultSetMapping is a ResultSetMappingBuilder, and the placeholder is specified, the arbitrary string specified as the placeholder will be replaced with the output of ResultSetMappingBuilder::generateSelectClause(), passed the table aliases. This allows native queries to be bootstrapped into an application as named queries, while also allowing the select clause to be automatically updated in the query as the metadata for the mapped entities changes. Because native queries are not parsed in any way, a string placeholder is required to be able to interpolate the select clause into the query.
admin added the Improvement label 2026-01-22 14:20:38 +01:00
admin closed this issue 2026-01-22 14:20:38 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 3, 2014):

Comment created by @doctrinebot:

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

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

@doctrinebot commented on GitHub (May 3, 2014):

Issue was closed with resolution "Won't Fix"

@doctrinebot commented on GitHub (May 3, 2014): Issue was closed with resolution "Won't Fix"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3479