예제 #1
0
 @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);
 }
예제 #2
0
 /* (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);
 }
예제 #3
0
  @Override
  public List<Question> getQuestions() {

    return questionDAO.findAll();
  }
예제 #4
0
  /* (non-Javadoc)
   * @see it.geosolutions.fra2015.services.SurveyService#findQuestion(java.lang.Long)
   */
  @Override
  public Question findQuestion(Long questionNumber) {

    return questionDAO.find(questionNumber);
  }