docs: public Query createQuery( QueryCommand command ) throws InvalidQueryException, RepositoryException {
          session.checkLive();
          if (command == null) {
              // The query is not well-formed and cannot be parsed ...
              throw new InvalidQueryException(JcrI18n.queryInLanguageIsNotValid.text(QueryLanguage.JCR_SQL2, command));
          }
          // Produce the expression string ...
          String expression = Visitors.readable(command);
          try {
              // Parsing must be done now ...
              PlanHints hints = new PlanHints();
              hints.showPlan = true;
              hints.hasFullTextSearch = true; // always include the score
              hints.qualifyExpandedColumnNames = true; // always qualify expanded names with the selector name in JCR-SQL2
              return resultWith(expression, QueryLanguage.JCR_SQL2, command, hints, null, null);
          } catch (org.modeshape.jcr.query.parse.InvalidQueryException e) {
              // The query was parsed, but there is an error in the query
              String reason = e.getMessage();
              throw new InvalidQueryException(JcrI18n.queryInLanguageIsNotValid.text(QueryLanguage.JCR_SQL2, expression, reason));
          }
      }