Gets the alias of root entity of JQL query

@param queryString JQL query
@return alias of root entity.
480152
public static String getAlias(String queryString) {
        Matcher m = ALIAS_PATTERN.matcher(queryString);
        return m.find() ? m.group(1) : null;
    }
311600
public static QueryType getQueryType(String query) {

        final String trimmedQuery = removeCommentAndWhiteSpace(query);
        if (trimmedQuery == null || trimmedQuery.length() < 1) {
            return QueryType.OTHER;
        }

        final char firstChar = trimmedQuery.charAt(0);
        final QueryType type;
        switch (firstChar) {
            case 'S':
            case 's':
                type = QueryType.SELECT;
                break;
            case 'I':
            case 'i':
                type = QueryType.INSERT;
                break;
            case 'U':
            case 'u':
                type = QueryType.UPDATE;
                break;
            case 'D':
            case 'd':
                type = QueryType.DELETE;
                break;
            default:
                type = QueryType.OTHER;
        }
        return type;
    }
337679
@SuppressWarnings("unchecked")
  public static <E> OqlBuilder<E> from(final String entityName, final String alias) {
    EntityType type = Model.getType(entityName);
    OqlBuilder<E> query = new OqlBuilder<E>();
    if (null != type) query.entityClass = (Class<E>) type.getEntityClass();
    query.alias = alias;
    query.select = "select " + alias;
    query.from = concat("from ", entityName, " ", alias);
    return query;
  }
1080231
private Query getNamedOrCreateQuery(String queryString) {
    if (queryString.charAt(0) == '@') return getSession().getNamedQuery(queryString.substring(1));
    else return getSession().createQuery(queryString);
  }
1144107
public R fetchQuery(String properties) {
    ((TQRootBean) _root).query().fetchQuery(_name, properties);
    return _root;
  }
570783
public String createQueryStringFromNode(Node node, int position, @Nullable Class<?> domainType) {

		StringBuilder query = new StringBuilder();
		if (position > 0) {
			query.append(node.isOr() ? " OR " : " AND ");
		}

		if (node.hasSiblings()) {
			if (node.isNegating()) {
				query.append("-");
			}
			if (!node.isRoot() || (node.isRoot() && node.isNegating())) {
				query.append('(');
			}

			int i = 0;
			for (Node nested : node.getSiblings()) {
				query.append(createQueryStringFromNode(nested, i++, domainType));
			}

			if (!node.isRoot() || (node.isRoot() && node.isNegating())) {
				query.append(')');
			}
		} else {
			query.append(createQueryFragmentForCriteria((Criteria) node, domainType));
		}
		return query.toString();
	}
360649
protected EntityType getEntityType(String attr) {
    String alias = Strings.substringBefore(attr, ".");
    EntityType entityType = (EntityType) entityTypes.get(alias);
    if (null == entityType) entityType = (EntityType) entityTypes.get(attr);
    return entityType;
  }
936887
private function parseQueryString($queryString)
    {
        parse_str($queryString, $parsed);

        $supported = $this->getSupportedParams();
        foreach ($parsed as $param => $value) {
            if (!isset($supported[$param])) {
                throw RestException::unsupportedQueryParam($param, array_keys($supported));
            }
        }

        $this->extractInclusions($parsed);
        $this->extractSorting($parsed);
        $this->extractFields($parsed);
        $this->extractPagination($parsed);
        $this->extractFilters($parsed);
        return $this;
    }
713106
function QueryString (qs) {
        var parts = qs.split('&');

        for (var i = 0, s = parts.length; i < s; i++) {
            var keyVal = parts[i].split('=');
            var key = decodeURIComponent(keyVal[0].replace(RX_PLUS, ' '));

            if (!key) {
                continue;
            }

            var value = keyVal[1] !== undefined ? decode(keyVal[1]) : null;

            if (typeof this[key] === 'undefined') {
                this[key] = value;
            } else {
                if (!(this[key] instanceof Array)) {
                    this[key] = [this[key]];
                }

                this[key].push(value);
            }
        }
    }
872623
function querystring(query) {
      var parser = /([^=?&]+)=([^&]*)/g
        , result = {}
        , part;

      //
      // Little nifty parsing hack, leverage the fact that RegExp.exec increments
      // the lastIndex property so we can continue executing this loop until we've
      // parsed all results.
      //
      for (;
        part = parser.exec(query);
        result[decodeURIComponent(part[1])] = decodeURIComponent(part[2])
      );

      return result;
    }
195785
public String getSQLColumn(String tabalis, String fieldname) {
        return this.aliasmap == null ? (tabalis == null ? fieldname : (tabalis + '.' + fieldname))
            : (tabalis == null ? aliasmap.getOrDefault(fieldname, fieldname) : (tabalis + '.' + aliasmap.getOrDefault(fieldname, fieldname)));
    }
815022
@Override
    public Query createNativeQuery(String sqlString)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "em.createNativeQuery(" + sqlString + ");\n" + toString());

        return getEMInvocationInfo(false).createNativeQuery(sqlString);
    }
560529
def parse_querystring(self, req, name, field):
        """"""
        return get_value(req.query_arguments, name, field)
996593
private org.hibernate.Query query(String hql, Class<?>... type)
  {
    org.hibernate.Query q = session.createQuery(hql);
    for(int i = 0; i < positionedParameters.length; i++) {
      q.setParameter(i, positionedParameters[i]);
    }
    for(Map.Entry<String, Object> entry : namedParameters.entrySet()) {
      Object value = entry.getValue();
      if(Types.isArray(value)) {
        Object[] parameter = (Object[])value;
        if(parameter.length == 0) {
          throw new HibernateException(String.format("Invalid named parameter |%s|. Empty array.", entry.getKey()));
        }
        q.setParameterList(entry.getKey(), parameter);
      }
      else if(Types.isCollection(value)) {
        Collection<?> parameter = (Collection<?>)value;
        if(parameter.isEmpty()) {
          throw new HibernateException(String.format("Invalid named parameter |%s|. Empty list.", entry.getKey()));
        }
        q.setParameterList(entry.getKey(), parameter);
      }
      else {
        q.setParameter(entry.getKey(), value);
      }
    }
    if(offset > 0) {
      q.setFirstResult(offset);
    }
    if(rowsCount > 0) {
      q.setMaxResults(rowsCount);
    }

    if(type.length > 0) {
      q.setResultTransformer(Transformers.aliasToBean(type[0]));
    }
    return q;
  }
230468
public R textQueryString(String query, TextQueryString options) {
    peekExprList().textQueryString(query, options);
    return root;
  }
913015
public static RepositoryQuery lookupFrom(EbeanQueryMethod method, EbeanServer ebeanServer) {
        final String queryName = method.getNamedQueryName();

        LOG.debug("Looking up named query {}", queryName);

        try {
            Query query = ebeanServer.createNamedQuery(method.getEntityInformation().getJavaType(), queryName);
            return new NamedEbeanQuery(method, ebeanServer, query);
        } catch (PersistenceException e) {
            LOG.debug("Did not find named query {}", queryName);
            return null;
        }
    }
776955
@Override
    public String getDataQuery(QueryFilter filter) {
        String query = getQuery();
        String whereClause = filter.getWhereClause();
        String result = null;
        if (whereClause != null && whereClause.length() > 0) {
            result = query.replaceAll(SUBSTITUTION_STRING, " AND " + whereClause);	
        } else {
            result = query.replaceAll(SUBSTITUTION_STRING, "");
        }
        return result;
    }