DDC-443: Adding a Many-To-One Unidirectional mapping to help clarify Association Mapping documentation #555

Closed
opened 2026-01-22 12:42:20 +01:00 by admin · 1 comment
Owner

Originally created by @doctrinebot on GitHub (Mar 18, 2010).

Originally assigned to: @jwage on GitHub.

Jira issue originally created by user grekker:

For one-to-one unidirectional and many-to-many unidirectional flipping the owning and inverse sides is fairly intuitive.

However, the example given for One-To-Many Unidirectional does not lend itself to being flipped around (since you use a @ManyToMany for a One-To-Many unidirectional, and a @ManyToOne for a Many-To-One unidirectional).

Yes, you can figure out what you are supposed to do by looking at the One-To-Many Bidirectional and tweaking it, but I think it should be more obvious than that.

I suggest at a minimum adding an example of Many-To-One for at least unidirectional (or perhaps a note under One-To-Many suggesting how to do the inverse), but you can add bidirectional and self-referencing for consistency if you think that will be better understood.

Probably the note is the best way to go about it; it gets the point across without potentially confusing people by having One-To-Many and Many-To-One as if they were fundamentally different things.

Originally created by @doctrinebot on GitHub (Mar 18, 2010). Originally assigned to: @jwage on GitHub. Jira issue originally created by user grekker: For one-to-one unidirectional and many-to-many unidirectional flipping the owning and inverse sides is fairly intuitive. However, the example given for One-To-Many Unidirectional does not lend itself to being flipped around (since you use a @ManyToMany for a One-To-Many unidirectional, and a @ManyToOne for a Many-To-One unidirectional). Yes, you can figure out what you are supposed to do by looking at the One-To-Many Bidirectional and tweaking it, but I think it should be more obvious than that. I suggest at a minimum adding an example of Many-To-One for at least unidirectional (or perhaps a note under One-To-Many suggesting how to do the inverse), but you can add bidirectional and self-referencing for consistency if you think that will be better understood. Probably the note is the best way to go about it; it gets the point across without potentially confusing people by having One-To-Many and Many-To-One as if they were fundamentally different things.
admin added the Improvement label 2026-01-22 12:42:20 +01:00
admin closed this issue 2026-01-22 12:42:21 +01:00
Author
Owner

@doctrinebot commented on GitHub (Apr 30, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Apr 30, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#555