Deleting objects in many-to-many
356806Feb 25 2003 — edited Mar 18 2003Hi,
I have a class holding a collection of another class, both types with their own descriptor. The collection is mapped as a many-to-many relationship, ie with a relational table.
I've marked the collection attribute in the first class as being privately owned, but when I try to delete an object of the first class, TopLink only generates the SQL to delete this object and the rows in the relational table, not the rows in the table that represents the actual objects I'm holding in my collection. Therefore, of course, I get an exception since there is a referential constraint from the relational table to the table with my collection objects.
How should I do this? Can it be done simple through the descriptor or do I have to use custom queries?
Kind regards,
Katarina