ObjectRetrievalTools<Question> objTool2 = new ObjectRetrievalTools<Question>();
List<Question> questionList = objTool2.getObjectList(Table.Question, "groupId", groupId);
//delete the questions from the db
for (Iterator<Question> questIterator = questionList.iterator(); questIterator.hasNext();) {
Question questionDelete = questIterator.next();
//get questionId for answer deletion
int questionId = questionDelete.getId();
myTools.dataRemoval(questionDelete);
//get all the answers associated with the question id
ObjectRetrievalTools<Answer> objTool3 = new ObjectRetrievalTools<Answer>();
List<Answer> answerList = objTool3.getObjectList(Table.Answer, "questionId", questionId);