DDC-3373: [GH-1174] Fix associations with a custom type for identifiers #4167

Closed
opened 2026-01-22 14:36:26 +01:00 by admin · 9 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 6, 2014).

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 jaspernbrouwer:

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

Message:

I was running an experiment using a custom DBAL type, which converts a UUID string (in PHP) to 16 bytes binary string (in SQL) and vice versa, as identifier for a couple of entities. I noticed some associations weren't loaded correctly. This PR attempts to fix that issue.

I've included several tests:

  • Loading a OneToOne association
  • Loading a OneToOne association with composite identifier
  • Loading a OneToOne association with composite identifier including a foreign one
  • Loading a OneToMany association
  • Loading a OneToMany association with composite identifier
  • Loading a OneToMany association with composite identifier including a foreign one
  • Loading a ManyToMany association
  • Loading a ManyToMany association with composite identifier
  • Loading a ManyToMany association with composite identifier including a foreign one

During the "ManyToMany association tests ...", I discovered the join-table wasn't populated properly. The columns were filled with the UUID string (in stead of the 16 bytes binary string). This has been addressed as well.

I've included these tests to verify that:

  • Removing entities from a ManyToMany association
  • Removing entities from a ManyToMany association with composite identifier
  • Removing entities from a ManyToMany association with composite identifier including a foreign one

When applying a fix for the "Loading a OneToMany association with composite identifier including a foreign one" test, the "Loading a OneToOne association with composite identifier including a foreign one" test started to produce an error.

This is due to the Proxy object containing a 16 bytes binary string (in stead of the UUID string) for the foreign identifier.

Also the "Removing entities from a ManyToMany association with composite identifier including a foreign one" tests keeps failing because there's a 16 bytes binary string (in stead of the UUID string) for the foreign identifier in the Collection.

I have a feeling these last 2 cases are not because of an issue in the Persisters, but because of an issue in the Hydrators. Unfortunately I don't know where to begin looking :(

I could really need some help finishing this up!

Originally created by @doctrinebot on GitHub (Nov 6, 2014). 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 jaspernbrouwer: Url: https://github.com/doctrine/doctrine2/pull/1174 Message: I was running an experiment using a custom DBAL type, which converts a UUID string (in PHP) to 16 bytes binary string (in SQL) and vice versa, as identifier for a couple of entities. I noticed some associations weren't loaded correctly. This PR attempts to fix that issue. I've included several tests: - Loading a OneToOne association - Loading a OneToOne association with composite identifier - Loading a OneToOne association with composite identifier including a foreign one - Loading a OneToMany association - Loading a OneToMany association with composite identifier - Loading a OneToMany association with composite identifier including a foreign one - Loading a ManyToMany association - Loading a ManyToMany association with composite identifier - Loading a ManyToMany association with composite identifier including a foreign one During the "_ManyToMany association tests ..._", I discovered the join-table wasn't populated properly. The columns were filled with the UUID string (in stead of the 16 bytes binary string). This has been addressed as well. I've included these tests to verify that: - Removing entities from a ManyToMany association - Removing entities from a ManyToMany association with composite identifier - Removing entities from a ManyToMany association with composite identifier including a foreign one When applying a fix for the "_Loading a OneToMany association with composite identifier including a foreign one_" test, the "_Loading a OneToOne association with composite identifier including a foreign one_" test started to produce an error. This is due to the Proxy object containing a 16 bytes binary string (in stead of the UUID string) for the foreign identifier. Also the "_Removing entities from a ManyToMany association with composite identifier including a foreign one_" tests keeps failing because there's a 16 bytes binary string (in stead of the UUID string) for the foreign identifier in the Collection. I have a feeling these last 2 cases are not because of an issue in the Persisters, but because of an issue in the Hydrators. Unfortunately I don't know where to begin looking :( I could really need some help finishing this up!
admin added the Bug label 2026-01-22 14:36:26 +01:00
admin closed this issue 2026-01-22 14:36:27 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 6, 2014):

@doctrinebot commented on GitHub (Nov 6, 2014): - depends on [DDC-3380: [GH-1178] Fixing associations using UUIDs](http://www.doctrine-project.org/jira/browse/DDC-3380) - duplicates [DDC-3380: [GH-1178] Fixing associations using UUIDs](http://www.doctrine-project.org/jira/browse/DDC-3380)
Author
Owner

@doctrinebot commented on GitHub (Nov 7, 2014):

Comment created by jasper@nerdsweide.nl:

PS: I've applied this fix to the 2.4 branch (in stead of master) on purpose, because I'm going to use this in a project and unfortunately can't wait until it's merged back into 2.4.

If this is a problem and must be done on master, I'll look into that.

@doctrinebot commented on GitHub (Nov 7, 2014): Comment created by jasper@nerdsweide.nl: PS: I've applied this fix to the 2.4 branch (in stead of master) on purpose, because I'm going to use this in a project and unfortunately can't wait until it's merged back into 2.4. If this is a problem and must be done on master, I'll look into that.
Author
Owner

@doctrinebot commented on GitHub (Nov 7, 2014):

Comment created by @ocramius:

[~jasper@nerdsweide.nl] multiple versions may be affected: we just need to be sure that the bug wasn't already fixed in master (2.5), so please check that one as well.

@doctrinebot commented on GitHub (Nov 7, 2014): Comment created by @ocramius: [~jasper@nerdsweide.nl] multiple versions may be affected: we just need to be sure that the bug wasn't already fixed in `master` (`2.5`), so please check that one as well.
Author
Owner

@doctrinebot commented on GitHub (Nov 7, 2014):

Comment created by jasper@nerdsweide.nl:

Master is also affected. I think I've got some spare time this evening, so I'll port the PR to master.

Could you perhaps look at the remaining issue and maybe give some hint on where I should start looking? I would appreciate it if I could finish that up too this evening.

@doctrinebot commented on GitHub (Nov 7, 2014): Comment created by jasper@nerdsweide.nl: Master is also affected. I think I've got some spare time this evening, so I'll port the PR to master. Could you perhaps look at the remaining issue and maybe give some hint on where I should start looking? I would appreciate it if I could finish that up too this evening.
Author
Owner

@doctrinebot commented on GitHub (Nov 9, 2014):

Comment created by @doctrinebot:

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

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

@doctrinebot commented on GitHub (Nov 10, 2014):

Comment created by jasper@nerdsweide.nl:

The PR has been ported to master:

http://www.doctrine-project.org/jira/browse/DDC-3380
https://github.com/doctrine/doctrine2/pull/1178

This ticket can be closed.

@doctrinebot commented on GitHub (Nov 10, 2014): Comment created by jasper@nerdsweide.nl: The PR has been ported to master: http://www.doctrine-project.org/jira/browse/[DDC-3380](http://www.doctrine-project.org/jira/browse/DDC-3380) https://github.com/doctrine/doctrine2/pull/1178 This ticket can be closed.
Author
Owner

@doctrinebot commented on GitHub (Nov 10, 2014):

Issue was closed with resolution "Duplicate"

@doctrinebot commented on GitHub (Nov 10, 2014): Issue was closed with resolution "Duplicate"
Author
Owner

@doctrinebot commented on GitHub (Nov 10, 2014):

Comment created by @doctrinebot:

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

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

@doctrinebot commented on GitHub (Jan 17, 2015):

Comment created by @doctrinebot:

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

@doctrinebot commented on GitHub (Jan 17, 2015): Comment created by @doctrinebot: A related Github Pull-Request [GH-1178] was closed: https://github.com/doctrine/doctrine2/pull/1178
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4167