mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-289: Owning Side OneToMany through Join-Table fails with MappingException #357
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Jan 31, 2010).
Jira issue originally created by user @beberlei:
Currently OneToMany through Join-Table can only be implemented using the @ManyToMany element as the @OneToMany fails with a MappingException requiring a "mappedBy".
@doctrinebot commented on GitHub (Jan 31, 2010):
Comment created by @beberlei:
Is this expected behaviour to use the @ManyToMany for this? It seems there is too much special code needed to let the @OneToMany support this also.
@doctrinebot commented on GitHub (Jan 31, 2010):
Comment created by romanb:
Yes, it is expected behavior to map this as many-to-many.
You simply map it as a uni-directional many-to-many and put a unique constraint on 1 join column of the join table and voila, you have effectively a uni-directional one-to-many from point of view of your classes.
@doctrinebot commented on GitHub (Jan 31, 2010):
Comment created by @beberlei:
Added little note to documentation and closed.
@doctrinebot commented on GitHub (Jan 31, 2010):
Issue was closed with resolution "Fixed"