@Override public List<Question> getQuestions(Integer[] questionNumbers) { Search searchCriteria = new Search(); searchCriteria.addFilterIn("id", Arrays.asList(questionNumbers)); searchCriteria.addSort("id", false); return questionDAO.search(searchCriteria); }
/* (non-Javadoc) * @see it.geosolutions.fra2015.services.SurveyService#upsert(it.geosolutions.fra2015.server.model.survey.Question) */ @Override public void upsert(Question question) throws BadRequestServiceEx, NotFoundServiceEx { for (Entry entry : question.getEntries()) { entry.setQuestion(question); if (entry.getEntryItems() != null) { for (EntryItem entryItems : entry.getEntryItems()) { entryItems.setEntry(entry); } } } questionDAO.persist(question); }
@Override public List<Question> getQuestions() { return questionDAO.findAll(); }
/* (non-Javadoc) * @see it.geosolutions.fra2015.services.SurveyService#findQuestion(java.lang.Long) */ @Override public Question findQuestion(Long questionNumber) { return questionDAO.find(questionNumber); }