I have two collections, athletes and scores. scores collection has a pointer to an athlete Id. When an athlete is deleted, I want to delete all the scores that are associated with that athlete. how do i do it? Is there a way to cascade delete like in a MasterDetail relationship?
I have three services created. DeleteAthleteService, QueryScoresService, DeleteScoreService. On the click of a delete button, i have a javascript that asks for a confirmation and then invokes the DeleteAthleteService. so far so good. How do I also go and delete the scores? If I query the scores using the QueryScoresService and store the array of Score Ids in a collection/list and put it in the local storage. Is there a way to invoke the DeleteScoreService with a collection instead of one id at a time? Also, how do I invoke the DeleteScoreService with an id from javascript?
Thanks