delete many to many relations

Topics: Developer Forum
Sep 8, 2007 at 8:02 AM
Hi, congratulation for Firebird it function very well
but how to erase many to many relation ?

here is my code :

Article a = Article.New("fly away");
Reader r = Reader.New("Batman");
r.Save();
a.Readers.Add(r);
a.Readers.Add(Reader.New("Spiderman"));
a.Save();

...

a.Readers.RemoveAt(0);
a.Save ();


the funtion removeAt delete the item in the class but not in the database table "Article_Reader"
if i add the function below, it's the line in reader table who will be deleted

a.Readers0.Delete ();

how to delete the line in Article_Reader without delete the line in Reader

thanks
Coordinator
Sep 8, 2007 at 8:23 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Sep 10, 2007 at 11:14 AM
It's done.
Sep 10, 2007 at 5:49 PM
bravo, well done !
you are really very quick, it's fantastic !

thanks