I have basically two Entities Entity1 and Entity2.
Entity1 contains this bit of Code:
@OneToMany(cascade=CascadeType.
EclipseLink does not currently support duplicates for OneToMany relationships. Duplicate are support for (basic) ElementCollection mappings.
Please vote for bug, https://bugs.eclipse.org/bugs/show_bug.cgi?id=256978
The best solution is to map the join table to another entity and define a 1-m to it with a 1-1 to the target.