serialize the QueryCriterion to a String expression.

This String expression can be deserialized by the deserialze method back.

@param queryCriterion
the QueryCriterion.
@return
the String expression.
186569
public static String serialize(QueryCriterion queryCriterion){
        if(queryCriterion instanceof EqualQueryCriterion){
            EqualQueryCriterion criterion = (EqualQueryCriterion) queryCriterion;
            return criterion.getMetadataKey() + " equals " + escapeString(criterion.getCriterion());
        } else if(queryCriterion instanceof NotEqualQueryCriterion){
            NotEqualQueryCriterion criterion = (NotEqualQueryCriterion) queryCriterion;
            return criterion.getMetadataKey() + " not equals " + escapeString(criterion.getCriterion());
        } else if(queryCriterion instanceof ContainQueryCriterion){
            ContainQueryCriterion criterion = (ContainQueryCriterion) queryCriterion;
            return criterion.getMetadataKey();
        } else if(queryCriterion instanceof NotContainQueryCriterion){
            NotContainQueryCriterion criterion = (NotContainQueryCriterion) queryCriterion;
            return "not " + criterion.getMetadataKey();
        } else if(queryCriterion instanceof InQueryCriterion){
            InQueryCriterion criterion = (InQueryCriterion) queryCriterion;
            StringBuilder sb = new StringBuilder(criterion.getMetadataKey());
            sb.append(" in [ ");
            for(String s : criterion.getCriterion()){
                sb.append(escapeString(s)).append(", ");
            }
            sb.append("]");
            return sb.toString();
        } else if(queryCriterion instanceof NotInQueryCriterion){
            NotInQueryCriterion criterion = (NotInQueryCriterion) queryCriterion;
            StringBuilder sb = new StringBuilder(criterion.getMetadataKey());
            sb.append(" not in [ ");
            for(String s : criterion.getCriterion()){
                sb.append(escapeString(s)).append(", ");
            }
            sb.append("]");
            return sb.toString();
        } else if(queryCriterion instanceof PatternQueryCriterion){
            PatternQueryCriterion criterion = (PatternQueryCriterion) queryCriterion;
            return criterion.getMetadataKey() + " matches " + escapeString(criterion.getCriterion());
        }
        return "";
    }
824189
public String findTextByQueryReplyAndQueryField(QueryReply queryReply, QueryField queryField) {
    EntityManager entityManager = getEntityManager();

    CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
    CriteriaQuery<String> criteria = criteriaBuilder.createQuery(String.class);
    Root<QueryQuestionOptionAnswer> root = criteria.from(QueryQuestionOptionAnswer.class);
    Join<QueryQuestionOptionAnswer, QueryOptionFieldOption> option = root.join(QueryQuestionOptionAnswer_.option);
    
    criteria.select(option.get(QueryOptionFieldOption_.text));
    
    criteria.where(
      criteriaBuilder.and(
        criteriaBuilder.equal(root.get(QueryQuestionOptionAnswer_.queryField), queryField),
        criteriaBuilder.equal(root.get(QueryQuestionOptionAnswer_.queryReply), queryReply)
      )
    );
    
    return getSingleResult(entityManager.createQuery(criteria));
  }
348028
public function convert(QueryCriterionInterface $query) {
        $value = '%' . $query->getValue();
        $value = $this->getDriverEscaper()->escape($value);
        $value = $this->getDriverEscaper()->quote($value);
        return '' .$this->setPropertyName($query->getName()) . ' ' . $this->getDriverEscaper()->reserved('object') . ' ' . $this->getOperator() . ' ' . $value . '';
    }
61498
public synchronized void putSelectionCriteria(SelectionCriteria criteria)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "putSelectionCriteria", criteria);

      checkValid();

      String discriminator = null;
      String selector = null;
      short selectorDomain = (short) SelectorDomain.SIMESSAGE.toInt();

      if (criteria != null)
      {
         discriminator = criteria.getDiscriminator();
         selector = criteria.getSelectorString();

         SelectorDomain selDomain = criteria.getSelectorDomain();
         if (selDomain != null)
         {
            selectorDomain = (short) selDomain.toInt();
         }
      }

      putShort(selectorDomain);
      putString(discriminator);
      putString(selector);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "putSelectionCriteria");
   }
230468
public R textQueryString(String query, TextQueryString options) {
    peekExprList().textQueryString(query, options);
    return root;
  }
283905
public function convert(QueryCriterionInterface $query) {
        if(!is_array($query->getValue())) {
            $value = '(' . $query->getValue() . ')';
        } else {
            $value = $this->setValuesList($query->getValue());
        }
        return '' .$this->setPropertyName($query->getName()) . ' ' . $this->getDriverEscaper()->reserved('object') . ' ' . $this->getOperator() . ' ' . $value . ' ';
    }
1180188
public static final void validateSearchCriteria(SearchCriteriaBean criteria) throws InvalidSearchCriteriaException {
        if (criteria.getPaging() != null) {
            if (criteria.getPaging().getPage() < 1) {
                throw new InvalidSearchCriteriaException(Messages.i18n.format("SearchCriteriaUtil.MissingPage")); //$NON-NLS-1$
            }
            if (criteria.getPaging().getPageSize() < 1) {
                throw new InvalidSearchCriteriaException(Messages.i18n.format("SearchCriteriaUtil.MissingPageSize")); //$NON-NLS-1$
            }
        }
        int count = 1;
        for (SearchCriteriaFilterBean filter : criteria.getFilters()) {
            if (filter.getName() == null || filter.getName().trim().length() == 0) {
                throw new InvalidSearchCriteriaException(Messages.i18n.format("SearchCriteriaUtil.MissingSearchFilterName", count)); //$NON-NLS-1$
            }
            if (filter.getValue() == null || filter.getValue().trim().length() == 0) {
                throw new InvalidSearchCriteriaException(Messages.i18n.format("SearchCriteriaUtil.MissingSearchFilterValue", count)); //$NON-NLS-1$
            }
            if (filter.getOperator() == null || !validOperators.contains(filter.getOperator())) {
                throw new InvalidSearchCriteriaException(Messages.i18n.format("SearchCriteriaUtil.MissingSearchFilterOperator", count)); //$NON-NLS-1$
            }
            count++;
        }
        if (criteria.getOrderBy() != null && (criteria.getOrderBy().getName() == null || criteria.getOrderBy().getName().trim().length() == 0)) {
            throw new InvalidSearchCriteriaException(Messages.i18n.format("SearchCriteriaUtil.MissingOrderByName")); //$NON-NLS-1$
        }
    }
439657
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException {

        String[] columns;
        try
        {
            columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName);
        }
        catch (QueryException e)
        {
            columns = new String[0];
        }

        // if there are columns that map the given property.. the property exists, so we don't need to add anything to the sql
        return columns.length > 0 ? "FALSE" : "TRUE";
    }
181173
function queryCriteriaToMongo(query, options) {
    var hash = {}, p, v, deep
    options = options || {}

    for (var key in query) {
        if (Object.prototype.hasOwnProperty.call(query, key) && (!options.ignore || options.ignore.indexOf(key) == -1)) {
            deep = (typeof query[key] === 'object' && !hasOrdinalKeys(query[key]))

            if (deep) {
                p = {
                    key: key,
                    value: queryCriteriaToMongo(query[key])
                }
            } else {
                p = comparisonToMongo(key, query[key])
            }

            if (p) {
                if (!hash[p.key]) {
                    hash[p.key] = p.value;
                } else {
                    hash[p.key] = Object.assign(hash[p.key], p.value);
                }
            }
        }
    }
    return hash
}
663105
public static Map<String, Object> parseQuerystring(String query) {
        String[] params = query.split("&");
        Map<String, Object> map = new HashMap<String, Object>();
        for (String param : params) {
            String[] nameValue = param.split("=");
            map.put(nameValue[0], nameValue[1]);
        }
        return map;
    }
818760
private static Query buildQuery(ClassDescriptor cld)
    {
        FieldDescriptor[] pkFields = cld.getPkFields();
        Criteria crit = new Criteria();

        for(int i = 0; i < pkFields.length; i++)
        {
            crit.addEqualTo(pkFields[i].getAttributeName(), null);
        }
        return new QueryByCriteria(cld.getClassOfObject(), crit);
    }
776852
protected static final QueryMap parseApiRequestQueryParams(String queryString) {
        QueryMap rval = new QueryMap();

        if (queryString != null) {
            try {
                String[] pairSplit = queryString.split("&"); //$NON-NLS-1$
                for (String paramPair : pairSplit) {
                    int idx = paramPair.indexOf("="); //$NON-NLS-1$
                    String key, value;
                    if (idx != -1) {
                        key =  URLDecoder.decode(paramPair.substring(0, idx), "UTF-8"); //$NON-NLS-1$
                        value = URLDecoder.decode(paramPair.substring(idx + 1), "UTF-8"); //$NON-NLS-1$
                    } else {
                        key = URLDecoder.decode(paramPair, "UTF-8"); //$NON-NLS-1$
                        value = null;
                    }
                    rval.add(key,  value);
                }
            } catch (UnsupportedEncodingException e) {
                throw new RuntimeException(e);
            }

        }

        return rval;
    }
1039771
private static Object readQueryString(String queryName,
                                          Class<?> paramType,
                                          Type genericType,
                                          Annotation[] paramAnns,
                                          Message m,
                                          String defaultValue,
                                          boolean decode) {

        MultivaluedMap<String, String> queryMap = new UriInfoImpl(m, null).getQueryParameters(decode);

        if ("".equals(queryName)) {
            return InjectionUtils.handleBean(paramType, paramAnns, queryMap, ParameterType.QUERY, m, false);
        }
        return InjectionUtils.createParameterObject(queryMap.get(queryName),
                                                    paramType,
                                                    genericType,
                                                    paramAnns,
                                                    defaultValue,
                                                    false,
                                                    ParameterType.QUERY, m);
    }
1210707
public QueryResultPage<T> queryPage(DynamoDBQueryExpression<T> queryExpression) {
        return mapper.<T>queryPage(model.targetType(), queryExpression);
    }
427160
static Object extractAttributeValue(Extractors extractors, InternalSerializationService serializationService,
                                        String attributeName, Data key, Object value, Object metadata) throws QueryException {
        Object result = extractAttributeValueIfAttributeQueryConstant(serializationService, attributeName, key, value);
        if (result == null) {
            boolean isKey = startsWithKeyConstant(attributeName);
            attributeName = getAttributeName(isKey, attributeName);
            Object target = isKey ? key : value;
            result = extractAttributeValueFromTargetObject(extractors, attributeName, target, metadata);
        }
        return result;
    }
582552
protected <O> CriteriaQuery<O> createCriteriaQuery(Class<O> clazz)
	{
		return getCriteriaBuilder().createQuery(clazz);
	}
70603
@SuppressWarnings({ "unchecked", "rawtypes" })
    public org.grails.datastore.mapping.query.api.Criteria eqAll(String propertyName, Closure<?> propertyValue) {
        return eqAll(propertyName, new grails.gorm.DetachedCriteria(targetClass).build(propertyValue));
    }