use of org.eyeseetea.malariacare.data.database.model.Match in project pictureapp by EyeSeeTea.
the class TreatmentTable method deleteRelatedTablesLines.
/**
* Deleting the matches, questionOption and questionThresholds related with the treatment
* table.
*/
private void deleteRelatedTablesLines(TreatmentMatch treatmentMatch) throws IOException {
Match match = treatmentMatch.getMatch();
List<QuestionOption> questionOptions = QuestionOption.getQuestionOptionsWithMatchId(match.getId_match());
for (QuestionOption questionOption : questionOptions) {
questionOption.delete();
}
List<QuestionThreshold> questionThresholds = QuestionThreshold.getQuestionThresholdsWithMatch(match.getId_match());
for (QuestionThreshold questionThreshold : questionThresholds) {
questionThreshold.delete();
}
match.delete();
}
Aggregations