コード例 #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);
  }