Bug #33397

Difference for ManyToMany with JoinTable annotation and without

Added by Christian Müller over 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Should have
Category:
Persistence
Start date:
2012-01-23
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

There is a difference between joinColumn creation with JoinTable annotation and without for ManyToMany relations. In case there is a JoinTable annotation (and no options for columns are set) the automatic creation inverses the columns so the join works but the columns are named wrong / used wrong.

So if you join class A and Class B the resulting join table will have columns for A identifier and B identifier but the inserted identifiers are exactly the opposite. This does not happen if the JoinTable Annotation is dropped completely.

Thanks to Kira Backes for noticing.

The fix is simple but probably a breaking change.

Also available in: Atom PDF