DDC-2792: [GH-846] joinColumn is not required in manyToMany #3490

Closed
opened 2026-01-22 14:20:50 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 14, 2013).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of terraqout:

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

Message:

in annotation you can don't write columns names:

/****
 * @ManyToMany(targetEntity="Group", inversedBy="users")
 * @JoinTable(name="users_groups")
 */

but in yaml you should:

manyToMany:
    groups:
        targetEntity: Group
        inversedBy: users
        joinTable:
            name: users_groups
        joinColumns:
            user_id:
            referencedColumnName: id
        inverseJoinColumns:
            group_id:
            referencedColumnName: id

this patch fixes this unexpected behavior

Originally created by @doctrinebot on GitHub (Nov 14, 2013). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user @doctrinebot: This issue is created automatically through a Github pull request on behalf of terraqout: Url: https://github.com/doctrine/doctrine2/pull/846 Message: in annotation you can don't write columns names: ``` /**** * @ManyToMany(targetEntity="Group", inversedBy="users") * @JoinTable(name="users_groups") */ ``` but in yaml you should: ``` manyToMany: groups: targetEntity: Group inversedBy: users joinTable: name: users_groups joinColumns: user_id: referencedColumnName: id inverseJoinColumns: group_id: referencedColumnName: id ``` this patch fixes this unexpected behavior
admin added the Bug label 2026-01-22 14:20:50 +01:00
admin closed this issue 2026-01-22 14:20:52 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 3, 2014):

Comment created by @doctrinebot:

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

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

@doctrinebot commented on GitHub (Jan 3, 2014):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jan 3, 2014): 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#3490