@Override
  public boolean updateQuestionRevision(QuestionRevision revision) {

    QuestionRevision lastRevision =
        findQuestionRevision(revision.getCountry(), revision.getQuestion());
    Long version = lastRevision.getVersion();
    if (lastRevision.getVersion() <= revision.getVersion()) {
      if (!questionRevisionDAO.remove(revision)) {
        return false;
      } else {
        lastRevision.setVersion(version + 1);
        questionRevisionDAO.merge(lastRevision);
        return true;
      }
    }

    return false;
  }
 @Override
 public QuestionRevision findQuestionRevision(Country country, Question question) {
   Search searchCriteria = new Search(QuestionRevision.class);
   searchCriteria.addFilterEqual("country", country);
   searchCriteria.addFilterEqual("question", question);
   List<QuestionRevision> qr = questionRevisionDAO.search(searchCriteria);
   if (qr.size() > 0) {
     return qr.get(0);
   }
   return null;
 }
 @Override
 public void insertQuestionRevision(QuestionRevision question) {
   questionRevisionDAO.persist(question);
 }