/** * @param surveyId * @param questionId * @param surveyQuestion * @return */ @Transactional @Override public boolean addQuestionToSurvey( Long surveyId, Long questionId, SurveyQuestionDTO surveyQuestion) { Validate.isTrue(surveyId != null && questionId != null, "Survey and question cannot be null"); JpaSurveyQuestion sq = new JpaSurveyQuestion(); sq.setNumAllowedAnswers(surveyQuestion.getNumAllowedAnswers()); sq.setSequence(surveyQuestion.getSequence()); JpaSurveyQuestion newSurveyQuestion = jpaSurveyDao.attachQuestionToSurvey(surveyId, questionId, sq); return newSurveyQuestion != null; }