code: private String appendWhereClauseWithScroll(String parsedQuery)
      {
  
          String queryWithoutLimit = parsedQuery.replaceAll(
                  parsedQuery.substring(parsedQuery.lastIndexOf(CQLTranslator.LIMIT), parsedQuery.length()), "");
  
          CQLTranslator translator = new CQLTranslator();
  
          final String tokenCondition = prepareNext(translator, queryWithoutLimit);
  
          StringBuilder builder = new StringBuilder(queryWithoutLimit);
  
          if (tokenCondition != null)
          {
              if (query.getKunderaQuery().getFilterClauseQueue().isEmpty())
              {
                  builder.append(CQLTranslator.ADD_WHERE_CLAUSE);
              }
              else
              {
                  builder.append(CQLTranslator.AND_CLAUSE);
              }
              builder.append(tokenCondition);
          }
  
          String replaceQuery = replaceAndAppendLimit(builder.toString());
          builder.replace(0, builder.toString().length(), replaceQuery);
          translator.buildFilteringClause(builder);
  
          // in case of fetch by ID, token condition will be null and results will
          // not be empty.
          return checkOnEmptyResult() && tokenCondition == null ? null : builder.toString();
      }
docs: Appends where claues and prepare for next fetch. Method to be called in
  case cql3 enabled.
  
  @param parsedQuery
  parsed query.
  
  @return cql3 query to be executed.