Creates an appropriate Ebean query from an {@link EbeanServer} according to the current {@link AbstractEbeanQuery}
type.

@param queryString
@return
770892
protected EbeanQueryWrapper createEbeanQuery(String queryString) {
        EbeanServer ebeanServer = getEbeanServer();

        ResultProcessor resultFactory = getQueryMethod().getResultProcessor();
        ReturnedType returnedType = resultFactory.getReturnedType();

        return EbeanQueryWrapper.ofEbeanQuery(ebeanServer.createQuery(returnedType.getReturnedType(), queryString));
    }
1332348
@SuppressWarnings({ "unchecked", "rawtypes" })
    public static Map<String, Object> fromQueryString(String queryString) {
        Map<String, Object> result = new LinkedHashMap<String, Object>();
        if (queryString.startsWith("?")) queryString = queryString.substring(1);

        String[] pairs = queryString.split("&");

        for (String pair : pairs) {
            int i = pair.indexOf('=');
            if (i > -1) {
                try {
                    String name = URLDecoder.decode(pair.substring(0, i), "UTF-8");
                    String value = URLDecoder.decode(pair.substring(i+1, pair.length()), "UTF-8");

                    Object current = result.get(name);
                    if (current instanceof List) {
                        ((List)current).add(value);
                    }
                    else if (current != null) {
                        List multi = new ArrayList();
                        multi.add(current);
                        multi.add(value);
                        result.put(name, multi);
                    }
                    else {
                        result.put(name, value);
                    }
                } catch (UnsupportedEncodingException e) {
                    // ignore
                }
            }
        }

        return result;
    }
1368071
@Override
    public Query prepareQuery(String queryString, String baseURI) throws RepositoryException, MalformedQueryException {
        return prepareQuery(QueryLanguage.SPARQL, queryString, baseURI);
    }
1353937
public static String getKeyQuery(String queryString, String name) {
        Matcher m = FROM_PATTERN.matcher(queryString);
        if (m.find()) {
            StringBuilder sb = new StringBuilder("SELECT ");
            sb.append(getAlias(queryString));
            sb.append(".");
            sb.append(name);
            sb.append(" ");
            sb.append(m.group());
            return sb.toString();
        }

        return null;
    }
951774
public EbeanQueryWrapper bind(EbeanQueryWrapper query) {

        Assert.notNull(query, "EbeanQueryWrapper must not be null!");

        int bindableParameterIndex = 0;
        int queryParameterPosition = 1;

        for (Parameter parameter : parameters) {

            if (canBindParameter(parameter)) {

                Object value = accessor.getBindableValue(bindableParameterIndex);
                bind(query, parameter, value, queryParameterPosition++);
                bindableParameterIndex++;
            }
        }

        return query;
    }
178348
@Override
    public final Query createNativeQuery(String sqlString)
    {
        checkClosed();
        return getPersistenceDelegator().createQuery(sqlString, getPersistenceUnit());
    }
447281
public static QueryBuilderFrom from(final String sourceVarName)
    {
        final Query query = new Query();
        query.setInputVariablesName(sourceVarName);
        return query;
    }
964985
@Override
    public <T> Query<T> createQuery(Class<T> entityType) {
        Assert.notNull(entityType, "entityType must not null");
        return ebeanServer.find(entityType);
    }
1017284
def query(self, queryString):
    '''
    
    '''
    self._setHeaders('query')
    return self._sforce.service.query(queryString)
760
@Override
    public Query createQuery(String qlString)
    {
        try
        {
            return ivEm.createQuery(qlString);
        } finally
        {
            if (!inJTATransaction())
            {
                ivEm.clear();
            }
        }
    }
1319818
private static MBeanServer setQueryExpServer(QueryExp query, MBeanServer toSet) {
        // We assume the QueryExp is a QueryEval subclass or uses the QueryEval thread local
        // mechanism to store any existing MBeanServer. If that's not the case we have no
        // way to access the old mbeanserver to let us restore it
        MBeanServer result = QueryEval.getMBeanServer();
        query.setMBeanServer(toSet);
        return result;
    }
1104376
@Override
    public <T> Query<T> createSqlQueryMappingColumns(Class<T> entityType,
                                                     String sql,
                                                     Map<String, String> columnMapping) {
        Assert.notNull(entityType, "entityType must not null");
        Assert.hasText(sql, "sql must has text");
        Assert.notEmpty(columnMapping, "columnMapping must not empty");
        RawSqlBuilder rawSqlBuilder = RawSqlBuilder.parse(sql);
        columnMapping.entrySet().forEach(entry -> {
            rawSqlBuilder.columnMapping(entry.getKey(), entry.getValue());
        });
        return ebeanServer.find(entityType).setRawSql(rawSqlBuilder.create());
    }
381490
public static <K, V> CacheEventFilterConverter<K, V, ObjectFilter.FilterResult> makeFilter(String queryString) {
      return makeFilter(queryString, null);
   }
1195389
public static RequestParams getRequestParams(String queryString) {
        if (null == queryString)
            return null;

        QueryStringParser parser = new QueryStringParser(queryString);
        RequestParams result = new RequestParams();
        while (parser.next()) {
            result.put(parser.getName(), parser.getValue());
        }
        return result;
    }
26423
public static SqlBuilder sql(final String queryStr) {
    SqlBuilder sqlQuery = new SqlBuilder();
    sqlQuery.statement = queryStr;
    return sqlQuery;
  }
413075
public QueryType<EntityBeanType<T>> getOrCreateQuery()
   {
      List<Node> nodeList = childNode.get("query");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new QueryTypeImpl<EntityBeanType<T>>(this, "query", childNode, nodeList.get(0));
      }
      return createQuery();
   }
1277701
protected String buildQuery(Properties parms, RequestType type) {
    if (parms.isEmpty())
      type = RequestType.query;
    RString result = new RString(_queryHtml);
    result.replace("REQ_NAME", this.getClass().getSimpleName());
    StringBuilder query = new StringBuilder();
    query.append("<form onsubmit='return false;'>");
    RString script = new RString(_queryJs);
    script.replace("REQUEST_NAME", getClass().getSimpleName());
    for (Argument arg: _arguments) {
      try {
        arg.check(RequestQueries.this, parms.getProperty(arg._name,""));
        queryArgumentValueSet(arg, parms);
      } catch( IllegalArgumentException e ) {
        // in query mode only display error for arguments present
        if ((type != RequestType.query) || !parms.getProperty(arg._name,"").isEmpty())
          query.append("<div class='alert alert-error'>"+e.getMessage()+"</div>");
      }
      if (arg._hideInQuery)
        continue;
      if (!arg.disabled()) {
        RString x = script.restartGroup("REQUEST_ELEMENT");
        x.replace("ELEMENT_NAME",arg._name);
        // If some Argument has prerequisites, and those pre-reqs changed on
        // this very page load then we do not assign the arg here: the values
        // passed will be something valid from the PRIOR page - based on the
        // old pre-req - and won't be correct.  Not assigning them here means
        // we'll act "as if" the field was never filled in.
        if( arg._prerequisites != null ) {
          StringBuilder sb = new StringBuilder("if( ");
          ArrayList<RequestArguments.Argument> preqs = arg._prerequisites;
          for( RequestArguments.Argument dep : preqs )
            sb.append("specArg!=='").append(dep._name).append("' && ");
          sb.append("true ) ");
          x.replace("ELEMENT_PREQ",sb);
        }
        x.append();
        x = script.restartGroup("ELEMENT_VALUE");
        x.replace("ELEMENT_NAME",arg._name);
        x.replace("BODY","function query_value_"+arg._name+"() { "+arg.jsValue()+"} ");
        x.append();
      }
      if (arg.refreshOnChange()) {
        RString x = script.restartGroup("ELEMENT_ONCHANGE");
        x.replace("BODY",arg.jsRefresh("query_refresh"));
        x.append();
      }
      RString x = script.restartGroup("ELEMENT_ADDONS");
      x.replace("BODY", arg.jsAddons());
      x.append();
    }
    for(Argument arg:_arguments){
      if (arg._hideInQuery)
        continue;
      query.append(arg.query());
    }
    query.append("</form>");
    result.replace("QUERY",query.toString());
    result.replace("SCRIPT",script.toString());
    return result.toString();
  }

}