[PR #1061] [CLOSED] Master Doctrine dont use custom schemas #9101

Closed
opened 2026-01-22 16:03:13 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/1061
Author: @cirovargas
Created: 6/17/2014
Status: Closed

Base: masterHead: 2.4


📝 Commits (10+)

  • e600757 Corrected PHP type for "decimal" mapping type
  • 9767a81 Updated EntityGeneratorTest::testEntityTypeAlias
  • ff34aaa Updated EntityGeneratorTest::testEntityTypeAlias
  • b324a21 Merge branch 'DDC-2587' into 2.4
  • edaf9b6 Skip not mapped public properties in SchemaValidator
  • ae12fa6 Merge branch 'DDC-2577' into 2.4
  • 2438325 Appending the Paginator tree walker hint, instead of removing all the other hints.
  • 5aad1df Added docblock.
  • f995515 Added a test which verifies that the tree walkers are kept.
  • 6a73608 Fixed name colision.

📊 Changes

87 files changed (+2749 additions, -387 deletions)

View changed files

📝 .travis.yml (+1 -1)
📝 UPGRADE.md (+6 -0)
📝 build.properties (+1 -9)
📝 build.xml (+87 -100)
📝 composer.json (+6 -4)
📝 docs/en/index.rst (+2 -1)
📝 docs/en/reference/caching.rst (+1 -1)
📝 docs/en/reference/configuration.rst (+1 -1)
📝 docs/en/reference/events.rst (+41 -25)
📝 docs/en/reference/faq.rst (+1 -1)
📝 docs/en/toc.rst (+8 -4)
📝 doctrine-mapping.xsd (+1 -0)
📝 lib/Doctrine/ORM/AbstractQuery.php (+13 -1)
📝 lib/Doctrine/ORM/EntityManager.php (+3 -12)
���� lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php (+27 -23)
📝 lib/Doctrine/ORM/Internal/Hydration/HydrationException.php (+14 -0)
📝 lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php (+7 -1)
📝 lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php (+7 -1)
📝 lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php (+20 -3)
📝 lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php (+1 -4)

...and 67 more files

📄 Description

When i can access a database with a user and map other user schema, example:

I connect to the server using USER1 credentials and need to use USER2 schema

Ccctually this is not suported:

Sugestions:

set a new config parameter with owner to put on front query like select * from OWNER.TABLE

and on the mapping update query mappings with these:

swap this:

doctrine\dbal\lib\Doctrine\DBAL\Platforms\OraclePlatform.php
public function getListSequencesSQL($database)
  322      {
  323:         return "SELECT sequence_name, min_value, increment_by FROM sys.all_sequences ".
  324                 "WHERE SEQUENCE_OWNER = '".strtoupper($database)."'";
  325      }
  ...
  387      public function getListViewsSQL($database)
  388      {
  389:         return 'SELECT view_name, text FROM sys.user_views';
  390      }

FOR THIS

public function getListSequencesSQL($database,$owner)
{
    return "SELECT sequence_name, min_value, increment_by FROM sys.all_sequences ".
           "WHERE SEQUENCE_OWNER = '".$owner."'";
}


/**
 * {@inheritDoc}
 */
public function getListSequencesSQL($database,$owner)
{
    return "SELECT sequence_name, min_value, increment_by FROM sys.all_sequences ".
           "WHERE SEQUENCE_OWNER = '".$owner."'";
}

Worked fine for me on tests.

Tnks


🔄 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/1061 **Author:** [@cirovargas](https://github.com/cirovargas) **Created:** 6/17/2014 **Status:** ❌ Closed **Base:** `master` ← **Head:** `2.4` --- ### 📝 Commits (10+) - [`e600757`](https://github.com/doctrine/orm/commit/e6007575e1dd5d8ccc0d7f805ebe8c8898854569) Corrected PHP type for "decimal" mapping type - [`9767a81`](https://github.com/doctrine/orm/commit/9767a814a62aa6ed80b05e6155a2fb9b5334ad88) Updated EntityGeneratorTest::testEntityTypeAlias - [`ff34aaa`](https://github.com/doctrine/orm/commit/ff34aaaa2c6852a1d8ff812449aacbc23f68c6ed) Updated EntityGeneratorTest::testEntityTypeAlias - [`b324a21`](https://github.com/doctrine/orm/commit/b324a21abf3a51320dde02cd494bc11e29c60ace) Merge branch 'DDC-2587' into 2.4 - [`edaf9b6`](https://github.com/doctrine/orm/commit/edaf9b6813f3f7ab1d5710af86d1234e028021e8) Skip not mapped public properties in SchemaValidator - [`ae12fa6`](https://github.com/doctrine/orm/commit/ae12fa6b5b772607260e98c1b837bbcdfdd606e7) Merge branch 'DDC-2577' into 2.4 - [`2438325`](https://github.com/doctrine/orm/commit/243832555bb5e5e8a0cc2820d3cd036ce6c04d7b) Appending the Paginator tree walker hint, instead of removing all the other hints. - [`5aad1df`](https://github.com/doctrine/orm/commit/5aad1df149bebdfb051ea12d5e646316c3ec7232) Added docblock. - [`f995515`](https://github.com/doctrine/orm/commit/f9955152b21adec8f9c7298c7723dc56cafe67c9) Added a test which verifies that the tree walkers are kept. - [`6a73608`](https://github.com/doctrine/orm/commit/6a73608bafee41f504b4f6f1f81964ab9a9dc75b) Fixed name colision. ### 📊 Changes **87 files changed** (+2749 additions, -387 deletions) <details> <summary>View changed files</summary> 📝 `.travis.yml` (+1 -1) 📝 `UPGRADE.md` (+6 -0) 📝 `build.properties` (+1 -9) 📝 `build.xml` (+87 -100) 📝 `composer.json` (+6 -4) 📝 `docs/en/index.rst` (+2 -1) 📝 `docs/en/reference/caching.rst` (+1 -1) 📝 `docs/en/reference/configuration.rst` (+1 -1) 📝 `docs/en/reference/events.rst` (+41 -25) 📝 `docs/en/reference/faq.rst` (+1 -1) 📝 `docs/en/toc.rst` (+8 -4) 📝 `doctrine-mapping.xsd` (+1 -0) 📝 `lib/Doctrine/ORM/AbstractQuery.php` (+13 -1) 📝 `lib/Doctrine/ORM/EntityManager.php` (+3 -12) ���� `lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php` (+27 -23) 📝 `lib/Doctrine/ORM/Internal/Hydration/HydrationException.php` (+14 -0) 📝 `lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php` (+7 -1) 📝 `lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php` (+7 -1) 📝 `lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php` (+20 -3) 📝 `lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php` (+1 -4) _...and 67 more files_ </details> ### 📄 Description When i can access a database with a user and map other user schema, example: I connect to the server using USER1 credentials and need to use USER2 schema Ccctually this is not suported: Sugestions: set a new config parameter with owner to put on front query like select \* from OWNER.TABLE and on the mapping update query mappings with these: swap this: ``` doctrine\dbal\lib\Doctrine\DBAL\Platforms\OraclePlatform.php public function getListSequencesSQL($database) 322 { 323: return "SELECT sequence_name, min_value, increment_by FROM sys.all_sequences ". 324 "WHERE SEQUENCE_OWNER = '".strtoupper($database)."'"; 325 } ... 387 public function getListViewsSQL($database) 388 { 389: return 'SELECT view_name, text FROM sys.user_views'; 390 } ``` FOR THIS ``` public function getListSequencesSQL($database,$owner) { return "SELECT sequence_name, min_value, increment_by FROM sys.all_sequences ". "WHERE SEQUENCE_OWNER = '".$owner."'"; } /** * {@inheritDoc} */ public function getListSequencesSQL($database,$owner) { return "SELECT sequence_name, min_value, increment_by FROM sys.all_sequences ". "WHERE SEQUENCE_OWNER = '".$owner."'"; } ``` Worked fine for me on tests. Tnks --- <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 16:03:13 +01:00
admin closed this issue 2026-01-22 16:03:13 +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#9101