You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jira issue originally created by user georgevanvliet:
When two entities, both using a custom type for the "@id" column, have a "@manytomany" (bidirectional) relationship, the ManyToManyPersister does not take into account the custom type of the referenced id columns and therefore does not convert the values using the appropriate "convertToDatabaseValue" function.
The entities themselves are saved propery, but the insertion into the join table always fails.
The text was updated successfully, but these errors were encountered:
EntityA uses a custom type for its @id column (specifically so I can store UUIDs in a binary column...see DDC-3721)
EntityA has a (unidirectional) many-to-many association with EntityB, and the usual ArrayCollection initialization on the property
I clear the entire collection by calling ArrayCollection::clear()
I call EntityManager::flush()
No errors occur, but no rows actually get deleted from the database.
Through debugging, I found that ManyToManyPersister::getDeleteSQL() does not handle custom types like ManyToManyPersister::getDeleteRowSQL() or ManyToManyPersister::removeElement(). So the proper SQL DELETE statement doesn't get executed.
My current workaround is to loop through my collection of EntityB, calling ArrayCollection::removeElement() with each entity. Given the complexity of ManyToManyPersister, I'm a bit leery of attempting a fix and submitting a PR, but at least wanted to document my issue here.
Jira issue originally created by user georgevanvliet:
When two entities, both using a custom type for the "@id" column, have a "@manytomany" (bidirectional) relationship, the ManyToManyPersister does not take into account the custom type of the referenced id columns and therefore does not convert the values using the appropriate "convertToDatabaseValue" function.
The entities themselves are saved propery, but the insertion into the join table always fails.
The text was updated successfully, but these errors were encountered: