[PR #293] [MERGED] [DDC-1663]Native SQL Query Result Set Mappings #7985

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

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/293
Author: @FabioBatSilva
Created: 2/29/2012
Status: Merged
Merged: 4/16/2012
Merged by: @guilhermeblanco

Base: masterHead: DDC-1663


📝 Commits (10+)

  • 530e484 native query annotations
  • 91e4702 named native query metadata
  • 2b99612 sql result set mapping metadata
  • bfc7986 annotation driver and basic support
  • 015ea80 added support for resultClass and empty fields
  • 3b79951 mapping driver tests
  • f018a56 test native query with result class
  • f813223 test joined one-to-many and one-to-one
  • 0cc2583 test scalar result
  • 68665af test discriminator column

📊 Changes

36 files changed (+3470 additions, -19 deletions)

View changed files

📝 doctrine-mapping.xsd (+46 -0)
📝 lib/Doctrine/ORM/EntityRepository.php (+15 -0)
📝 lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php (+60 -0)
📝 lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php (+257 -1)
lib/Doctrine/ORM/Mapping/ColumnResult.php (+42 -0)
📝 lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php (+52 -0)
📝 lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php (+7 -0)
📝 lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php (+52 -0)
📝 lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php (+70 -4)
lib/Doctrine/ORM/Mapping/EntityResult.php (+58 -0)
lib/Doctrine/ORM/Mapping/FieldResult.php (+48 -0)
📝 lib/Doctrine/ORM/Mapping/MappingException.php (+52 -7)
lib/Doctrine/ORM/Mapping/NamedNativeQueries.php (+40 -0)
lib/Doctrine/ORM/Mapping/NamedNativeQuery.php (+63 -0)
lib/Doctrine/ORM/Mapping/SqlResultSetMapping.php (+56 -0)
lib/Doctrine/ORM/Mapping/SqlResultSetMappings.php (+40 -0)
📝 lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php (+156 -1)
📝 tests/Doctrine/Tests/Models/CMS/CmsAddress.php (+119 -0)
📝 tests/Doctrine/Tests/Models/CMS/CmsUser.php (+294 -0)
📝 tests/Doctrine/Tests/Models/Company/CompanyContract.php (+42 -0)

...and 16 more files

📄 Description

Hello

http://www.doctrine-project.org/jira/browse/DDC-1663

This patch adds support for native query mapping
This is not complete yet but a would like to get your sugestions about this.

The following annotations have been added :

@NamedNativeQuery : Is used to specify a native SQL named query.

@SqlResultSetMapping: Is used to specify the mapping of the result of a native SQL query.

@EntityResult: References an entity in the SELECT clause of a SQL query.

@FieldResult: Is used to map the columns specified in the SELECT list of the query to the properties or fields of the entity class.

@ColumnResult : References name of a column in the SELECT clause of a SQL query. (scalar values)

It is a very big feature so any suggestion are welcome. :)

Thanks


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/293 **Author:** [@FabioBatSilva](https://github.com/FabioBatSilva) **Created:** 2/29/2012 **Status:** ✅ Merged **Merged:** 4/16/2012 **Merged by:** [@guilhermeblanco](https://github.com/guilhermeblanco) **Base:** `master` ← **Head:** `DDC-1663` --- ### 📝 Commits (10+) - [`530e484`](https://github.com/doctrine/orm/commit/530e4840dd93357033b93a380be687231b430388) native query annotations - [`91e4702`](https://github.com/doctrine/orm/commit/91e47027720bbf387e724a5468bdc7284a8ef8b5) named native query metadata - [`2b99612`](https://github.com/doctrine/orm/commit/2b996128af1359b4ba2f0297c8692e7fa8c6de12) sql result set mapping metadata - [`bfc7986`](https://github.com/doctrine/orm/commit/bfc7986b20f66cd8cc96cc3f6f0b25feccb8f7d9) annotation driver and basic support - [`015ea80`](https://github.com/doctrine/orm/commit/015ea809b0d9580bba546ea2fa8d8d0edab0d372) added support for resultClass and empty fields - [`3b79951`](https://github.com/doctrine/orm/commit/3b79951824fbbfdaf1ff45560c5a63ae5e0c9d0c) mapping driver tests - [`f018a56`](https://github.com/doctrine/orm/commit/f018a56d6dbf587865fc59ee2ee5970724f74e29) test native query with result class - [`f813223`](https://github.com/doctrine/orm/commit/f813223036667f2eac66a85ab828d00ff46c278e) test joined one-to-many and one-to-one - [`0cc2583`](https://github.com/doctrine/orm/commit/0cc2583a026fe01435c0a1573897e02061ca170a) test scalar result - [`68665af`](https://github.com/doctrine/orm/commit/68665af6e8da91bc1ea350ba02c7e6ba65aae963) test discriminator column ### 📊 Changes **36 files changed** (+3470 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `doctrine-mapping.xsd` (+46 -0) 📝 `lib/Doctrine/ORM/EntityRepository.php` (+15 -0) 📝 `lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php` (+60 -0) 📝 `lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php` (+257 -1) ➕ `lib/Doctrine/ORM/Mapping/ColumnResult.php` (+42 -0) 📝 `lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php` (+52 -0) 📝 `lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php` (+7 -0) 📝 `lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php` (+52 -0) 📝 `lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php` (+70 -4) ➕ `lib/Doctrine/ORM/Mapping/EntityResult.php` (+58 -0) ➕ `lib/Doctrine/ORM/Mapping/FieldResult.php` (+48 -0) 📝 `lib/Doctrine/ORM/Mapping/MappingException.php` (+52 -7) ➕ `lib/Doctrine/ORM/Mapping/NamedNativeQueries.php` (+40 -0) ➕ `lib/Doctrine/ORM/Mapping/NamedNativeQuery.php` (+63 -0) ➕ `lib/Doctrine/ORM/Mapping/SqlResultSetMapping.php` (+56 -0) ➕ `lib/Doctrine/ORM/Mapping/SqlResultSetMappings.php` (+40 -0) 📝 `lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php` (+156 -1) 📝 `tests/Doctrine/Tests/Models/CMS/CmsAddress.php` (+119 -0) 📝 `tests/Doctrine/Tests/Models/CMS/CmsUser.php` (+294 -0) 📝 `tests/Doctrine/Tests/Models/Company/CompanyContract.php` (+42 -0) _...and 16 more files_ </details> ### 📄 Description Hello http://www.doctrine-project.org/jira/browse/DDC-1663 This patch adds support for native query mapping This is not complete yet but a would like to get your sugestions about this. The following annotations have been added : `@NamedNativeQuery` : Is used to specify a native SQL named query. `@SqlResultSetMapping`: Is used to specify the mapping of the result of a native SQL query. `@EntityResult`: References an entity in the SELECT clause of a SQL query. `@FieldResult`: Is used to map the columns specified in the SELECT list of the query to the properties or fields of the entity class. `@ColumnResult` : References name of a column in the SELECT clause of a SQL query. (scalar values) It is a very big feature so any suggestion are welcome. :) Thanks --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 15:57: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#7985