DDC-3450: Embeddables containing only nested embeddables are not hydrated properly #4256

Open
opened 2026-01-22 14:38:22 +01:00 by admin · 1 comment
Owner

Originally created by @doctrinebot on GitHub (Dec 16, 2014).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user jamesmoss:

I have the following object mapping:

{quote}
Location (entity)

  • name
  • bounds
    {quote}

{quote}
Bounds (embeddable)

  • northeast
  • southwest
    {quote}

{quote}
Coords (embeddable)

  • latitude
  • longitude
    {quote}

This setup works fine when persisting entities, the database schema is correct, etc. but when I fetch my Location entity afterwards the bounds property is wrong. It looks something like this. Calling getBounds() on Location returns something like:

{quote}
Coords

  • latitude
  • longitude
  • northeast
  • southwest
    {quote}

As if the Coords embeddable has been transposed with the Bounds embeddable.

If I add another property to Bounds that isn't an embeddable (say a string) then it's hydrated correctly.

Originally created by @doctrinebot on GitHub (Dec 16, 2014). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user jamesmoss: I have the following object mapping: {quote} Location (entity) - name <string> - bounds <Bounds> {quote} {quote} Bounds (embeddable) - northeast <Coords> - southwest <Coords> {quote} {quote} Coords (embeddable) - latitude <float> - longitude <float> {quote} This setup works fine when persisting entities, the database schema is correct, etc. but when I fetch my `Location` entity afterwards the `bounds` property is wrong. It looks something like this. Calling `getBounds()` on `Location` returns something like: {quote} Coords - latitude <float> - longitude <float> - northeast <Coords> - southwest <Coords> {quote} As if the `Coords` embeddable has been transposed with the `Bounds` embeddable. If I add another property to `Bounds` that isn't an embeddable (say a string) then it's hydrated correctly.
admin added the Bug label 2026-01-22 14:38:22 +01:00
Author
Owner

@doctrinebot commented on GitHub (Dec 16, 2014):

Comment created by @ocramius:

[~jamesmoss] could you come up with a small test case in https://github.com/doctrine/doctrine2/tree/v2.4.7/tests/Doctrine/Tests/ORM/Functional/Ticket ?

@doctrinebot commented on GitHub (Dec 16, 2014): Comment created by @ocramius: [~jamesmoss] could you come up with a small test case in https://github.com/doctrine/doctrine2/tree/v2.4.7/tests/Doctrine/Tests/ORM/Functional/Ticket ?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4256