eclipselink
eclipselink copied to clipboard
[ISSUE ] Many-to-many issue with duplicates.
Hi all,
I found an issue related to your ContainerPolicy.class.
If I defined entity with many-to-many relation without primary keys and allowed duplicates. So, every selection of entity will lead to unexpected 'INSERT' statement for duplicate inside many-to-many join table.
Reason is the following: Inside ContainerPolicy class, collectObjectForNewCollection method:
Inside such method:
So, as you can see, if my related entity don't have unique key, it will be deleted from originalKeyValues first and next duplicated related entity will inserted again. And it leads to unexpected INSERT for related duplicated entity
Hope, it will be useful for you.
Best Regards, Andrei