@Override
  public QueryObject apply(SurveyExecutionDependentQuery query) {
    FreeQuestionNumberGroup group = getGroup();

    if (group.getFreeQuestion().getAnswerType().equals(AnswerType.NUMBER)) {
      String tableAlias = getUniqueAlias("r_fna");

      query.connectToSurveyExecution("results_freenumberanswer", tableAlias, "surveyexecution_id");

      query.addAndCondition(
          PropertyCondition.equals(tableAlias + ".question_id", group.getFreeQuestion().getId()));

      //			String answer =  getUniqueAlias("answer");
      //			query.addQueryEntity("FreeNumberAnswer", answer);

      // connectToSurveyExecution(query, answer);

      applyRatingFilter(query, tableAlias + ".number", group);
    }

    return query;
  }
 /** Override, because we need the given value, not the val - 1. */
 @Override
 protected void onLowerBound(
     QueryObject query, String ratingAnswerAlias, RatingGroup ratingGroup) {
   query.addAndCondition(
       PropertyCondition.greaterOrEqual(ratingAnswerAlias, ratingGroup.getLowerBound()));
 }