Hydration fails because of keyword casing (oracle) #7410

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

Originally created by @patrick1100 on GitHub (Aug 20, 2024).

Bug Report

Q A
BC Break no?
Version 2.19.5

Summary

When using an Oracle database, we get the error "no identity/no ID values ​​set" on Windows systems or "Undefined array key 'myFieldName'" on Unix systems when using the find() method of an entity.

The entity is not found because the case of the key term in the FieldMappings array differs in the "hydration".

The correct upper/lower casing for the key in hydrateColumnInfo() of the AbstractHydrator.php will fix this issue
$key = $this->getSQLResultCasing($this->_platform, $key);

Current behavior

Exception "no identity/no ID values ​​set" on Windows systems or "Undefined array key 'myFieldName'" on Unix systems

How to reproduce

  1. Oracle Database with Tables/Cols in Uppercase
  2. Create an Entity for the Table
  3. Use find to get the Entity for a row
    $entityManager->find(MyEntity::class, 'myId');

Expected behavior

Returning the entity

Originally created by @patrick1100 on GitHub (Aug 20, 2024). ### Bug Report <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |------------ | ------ | BC Break | no? | Version | 2.19.5 #### Summary <!-- Provide a summary describing the problem you are experiencing. --> When using an Oracle database, we get the error `"no identity/no ID values ​​set" `on Windows systems or `"Undefined array key 'myFieldName'"` on Unix systems when using the `find() ` method of an entity. The entity is not found because the case of the key term in the FieldMappings array differs in the "hydration". The correct upper/lower casing for the key in `hydrateColumnInfo()` of the `AbstractHydrator.php` will fix this issue `$key = $this->getSQLResultCasing($this->_platform, $key);` #### Current behavior <!-- What is the current (buggy) behavior? --> Exception `"no identity/no ID values ​​set"` on Windows systems or `"Undefined array key 'myFieldName'"` on Unix systems #### How to reproduce <!-- Provide steps to reproduce the bug. If possible, also add a code snippet with relevant configuration, entity mappings, DQL etc. Adding a failing Unit or Functional Test would help us a lot - you can submit one in a Pull Request separately, referencing this bug report. --> 1. Oracle Database with Tables/Cols in Uppercase 2. Create an Entity for the Table 3. Use find to get the Entity for a row `$entityManager->find(MyEntity::class, 'myId');` #### Expected behavior <!-- What was the expected (correct) behavior? --> Returning the entity
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7410