Constructs a AVIMConversationsQuery that is the or of the given queries.

@param queries
@return
338879
public static AVIMConversationsQuery or(List<AVIMConversationsQuery> queries) {
    if (null == queries || 0 == queries.size()) {
      throw new IllegalArgumentException("Queries cannot be empty");
    }
    AVIMClient client = queries.get(0).client;
    AVIMConversationsQuery result = new AVIMConversationsQuery(client);
    for (AVIMConversationsQuery query : queries) {
      if (!client.getClientId().equals(query.client.getClientId())) {
        throw new IllegalArgumentException("All queries must be for the same client");
      }
      result.conditions.addOrItems(new QueryOperation("$or", "$or", query.conditions
              .compileWhereOperationMap()));
    }
    return result;
  }
1223426
public void runQueries(final List<Query> queries) throws Exception {
    final long start_time = System.currentTimeMillis() / 1000;

    // TODO - threadify it. We *could* have hundreds of queries and we don't
    // want to create that many threads. For now we'll just execute each one
    // serially
    final Thread reporter = new ProgressReporter();
    reporter.start();

    for (final Query query : queries) {
      final List<Scanner> scanners = Internal.getScanners(query);
      final List<Thread> threads = new ArrayList<Thread>(scanners.size());
      int i = 0;
      for (final Scanner scanner : scanners) {
        final FsckWorker worker = new FsckWorker(scanner, i++, this.options);
        worker.setName("Fsck #" + i);
        worker.start();
        threads.add(worker);
      }

      for (final Thread thread : threads) {
        thread.join();
        LOG.info("Thread [" + thread + "] Finished");
      }
    }
    reporter.interrupt();

    logResults();
    final long duration = (System.currentTimeMillis() / 1000) - start_time;
    LOG.info("Completed fsck in [" + duration + "] seconds");
  }
672591
protected QueryParameters[] getQueryParams(Object[][] params) {
        QueryParameters[] result = new QueryParameters[params.length];

        for (int i = 0; i < params.length; i++) {
            result[i] = new QueryParameters(params[i]);
        }

        return result;
    }
838376
private MtasSpanQuery createQuery(
      List<MtasCQLParserSentenceCondition> sentenceSequence)
      throws ParseException {
    if (sentenceSequence.size() == 1) {
      if (maximumOccurence > 1) {
        return new MtasSpanRecurrenceQuery(sentenceSequence.get(0).getQuery(),
            minimumOccurence, maximumOccurence, ignore, maximumIgnoreLength);
      } else {
        return sentenceSequence.get(0).getQuery();
      }
    } else {
      List<MtasSpanSequenceItem> clauses = new ArrayList<MtasSpanSequenceItem>();
      for (MtasCQLParserSentenceCondition sentence : sentenceSequence) {
        clauses.add(
            new MtasSpanSequenceItem(sentence.getQuery(), sentence.optional));
      }
      if (maximumOccurence > 1) {
        return new MtasSpanRecurrenceQuery(
            new MtasSpanSequenceQuery(clauses, ignore, maximumIgnoreLength),
            minimumOccurence, maximumOccurence, ignore, maximumIgnoreLength);
      } else {
        return new MtasSpanSequenceQuery(clauses, ignore, maximumIgnoreLength);
      }
    }
  }
763156
protected Query[] buildMtoNImplementorQueries(Collection owners, Collection children)
    {
        ClassDescriptor cld = getOwnerClassDescriptor();
        PersistenceBroker pb = getBroker();
        //Class topLevelClass = pb.getTopLevelClass(cld.getClassOfObject());
        //BrokerHelper helper = pb.serviceBrokerHelper();
        Collection queries = new ArrayList(owners.size());
        Collection idsSubset = new HashSet(owners.size());
        //Object[] fkValues;
        Object owner;
        Identity id;

        Iterator iter = owners.iterator();
        while (iter.hasNext())
        {
            owner = iter.next();
            id = pb.serviceIdentity().buildIdentity(cld, owner);
            idsSubset.add(id);
            if (idsSubset.size() == pkLimit)
            {
                queries.add(buildMtoNImplementorQuery(idsSubset));
                idsSubset.clear();
            }
        }

        if (idsSubset.size() > 0)
        {
            queries.add(buildMtoNImplementorQuery(idsSubset));
        }

        return (Query[]) queries.toArray(new Query[queries.size()]);
    }
1100811
private function _or($queries)
    {
        $this->where['$or'] = array();
        $length = count($queries);
        for ($i = 0; $i < $length; $i++)
        {
            $this->where['$or'][] = $queries[$i]->where;
        }

        return $this;
    }
648684
public Query withParams(Collection<Object> paramValues) {
        if (null == paramValues) {
            return this;
        }
        int i = 0;
        for (Object paramValue : paramValues) {
            paramIndexValues.put(++i, this.converterValue(paramValue));
        }
        return this;
    }
107917
public AVIMConversationsQuery whereEqualTo(String key, Object value) {
    conditions.whereEqualTo(key, value);
    return this;
  }
985387
function (query) {
            if (typeof query === 'string') {
                if (S.startsWith(query, '?')) {
                    query = query.slice(1);
                }
                query = new Query(encodeSpecialChars(query, reDisallowedInQuery));
            }
            this.query = query;
            return this;
        }
479587
public QueryResultsImpl getQueryResultsFromRHS(String queryName, Object... arguments) {
    	return internalGetQueryResult(true, queryName, arguments);
    }
524991
public Query getCreateQuery(boolean generateKey, boolean quick, ENTITY... entities) {
        return getCreateQuery(Arrays.asList(entities), generateKey, quick, null);
    }
1167742
protected String constructInStringsQuery(String query, Set<String> values) {
        String replace = "IN (?)";
        assert query.lastIndexOf(replace) == query.indexOf(replace);
        String sql = query.replace("IN (?)", "IN (%s)");

        StringBuffer list = new StringBuffer();
        for (String value : values) {
            if (list.length() > 0) {
                list.append(",");
            }
            value = String.format("'%s'", StringEscapeUtils.escapeSql(value));
            list.append(value);
        }

        return String.format(sql, list.toString());
    }
416052
public java.util.List<QueryInfo> getQueries() {
        if (queries == null) {
            queries = new com.amazonaws.internal.SdkInternalList<QueryInfo>();
        }
        return queries;
    }
1027014
protected QueryParameters[] getQueryParams(InputHandler[] inputHandlers) {
        QueryParameters[] result = new QueryParameters[inputHandlers.length];

        for (int i = 0; i < inputHandlers.length; i++) {
            result[i] = inputHandlers[i].getQueryParameters();
        }

        return result;
    }
106995
protected static function multiQuery(string $queries): void
  {
    if (self::$logQueries)
    {
      $time0 = microtime(true);

      $tmp = self::$mysqli->multi_query($queries);
      if ($tmp===false)
      {
        throw new DataLayerException(self::$mysqli->errno, self::$mysqli->error, $queries);
      }

      self::$queryLog[] = ['query' => $queries, 'time' => microtime(true) - $time0];
    }
    else
    {
      $tmp = self::$mysqli->multi_query($queries);
      if ($tmp===false)
      {
        throw new DataLayerException(self::$mysqli->errno, self::$mysqli->error, $queries);
      }
    }
  }
401146
function(queries) {
        var queryJSON = _.map(queries, function(q) {
          return q.toJSON().where;
        });

        this._where.$and = queryJSON;
        return this;
      }
807815
public static List<Map<String, Object>> queryForList(String sql, Object... args) {
		List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
		Connection con = null;
		ResultSet rs = null;
		PreparedStatement ps = null;
		try {
			con = getconnnection();
			ps = con.prepareStatement(sql);
			if (args != null) {
				for (int i = 0; i < args.length; i++) {
					ps.setObject((i + 1), args[i]);
				}
			}
			rs = ps.executeQuery();
			ResultSetMetaData rsmd = rs.getMetaData();
			int columnCount = rsmd.getColumnCount();
			while (rs.next()) {
				Map<String, Object> map = new HashMap<String, Object>();
				for (int i = 1; i <= columnCount; i++) {
					map.put(rsmd.getColumnLabel(i), rs.getObject(i));
				}
				result.add(map);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			close(rs, ps, con);
		}
		return result;
	}