<p>configFetchHistoryQuery.</p>

@param query a {@link io.ebean.Query} object.
@param id    a MODEL_ID object.
@param start a {@link java.sql.Timestamp} object.
@param end   a {@link java.sql.Timestamp} object.
@throws java.lang.Exception if any.
549877
protected void configFetchHistoryQuery(final Query<MODEL> query,
                                           final MODEL_ID id,
                                           final Timestamp start,
                                           final Timestamp end) throws Exception {

    }
1335619
@Override
    public void search(final Query query) {
        getDispatcher().invokeLater(new AsyncTask(SEARCH, listeners) {
            @Override
            public void invoke(List<TwitterListener> listeners) throws TwitterException {
                QueryResult result = twitter.search(query);
                for (TwitterListener listener : listeners) {
                    try {
                        listener.searched(result);
                    } catch (Exception e) {
                        logger.warn("Exception at search", e);
                    }
                }
            }
        });
    }
6830
public SparqlResult runQuery(String endpoint, String query) {
    return SparqlClient.execute(endpoint, query, username, password);
  }
3489
public void recolorQuery() throws Exception {
		PrefixManager man = apic.getMutablePrefixManager();

		String input = doc.getText(0, doc.getLength());
		ImmutableList<TargetAtom> current_query = parse(input, man);

		if (current_query == null) {
            JOptionPane.showMessageDialog(null, "An error occured while parsing the mappings. For more info, see the logs.");
			throw new Exception("Unable to parse the query: " + input + ", " + parsingException);
		}
		input = doc.getText(0, doc.getLength());

		resetStyles();

		int pos = input.indexOf("(", 0);
		while (pos != -1) {
			doc.setCharacterAttributes(pos, 1, brackets, false);
			pos = input.indexOf("(", pos + 1);
		}
		pos = input.indexOf(")", 0);
		while (pos != -1) {
			doc.setCharacterAttributes(pos, 1, brackets, false);
			pos = input.indexOf(")", pos + 1);
		}
		pos = input.indexOf(".", 0);
		while (pos != -1) {
			doc.setCharacterAttributes(pos, 1, black, false);
			pos = input.indexOf(".", pos + 1);
		}
		pos = input.indexOf(",", 0);
		while (pos != -1) {
			doc.setCharacterAttributes(pos, 1, black, false);
			pos = input.indexOf(",", pos + 1);
		}
		pos = input.indexOf(":", 0);
		while (pos != -1) {
			doc.setCharacterAttributes(pos, 1, black, false);
			pos = input.indexOf(":", pos + 1);
		}
		MutableOntologyVocabulary vocabulary = apic.getCurrentVocabulary();
		for (TargetAtom atom : current_query) {
			Optional<IRI> optionalPredicateIri = atom.getPredicateIRI();

			if (optionalPredicateIri.isPresent()) {
				IRI predicateIri = optionalPredicateIri.get();
				String shortIRIForm = man.getShortForm(predicateIri.getIRIString());

				if (vocabulary.classes().contains(predicateIri)) {
					ColorTask task = new ColorTask(shortIRIForm, clazz);
					tasks.add(task);
				} else if (vocabulary.objectProperties().contains(predicateIri)) {
					ColorTask task = new ColorTask(shortIRIForm, objectProp);
					tasks.add(task);
				} else if (vocabulary.dataProperties().contains(predicateIri)) {
					ColorTask task = new ColorTask(shortIRIForm, dataProp);
					tasks.add(task);
				} else if (vocabulary.annotationProperties().contains(predicateIri)) {
					ColorTask task = new ColorTask(shortIRIForm, annotProp);
					tasks.add(task);
				}
			}

			ImmutableList<ImmutableTerm> substitutedTerms = atom.getSubstitutedTerms();
			RDFAtomPredicate atomPredicate = (RDFAtomPredicate) atom.getProjectionAtom().getPredicate();

			ImmutableTerm term1 = atomPredicate.getSubject(substitutedTerms);
			ImmutableTerm term2 = atomPredicate.getObject(substitutedTerms);

			if (term1 instanceof IRIConstant) {
				String rendered = man.getShortForm(((IRIConstant) term1).getIRI().toString());
				ColorTask task = new ColorTask(rendered, individual);
				tasks.add(task);
			}
			if (term2 instanceof IRIConstant) {
				String rendered = man.getShortForm(((IRIConstant) term2).getIRI().toString());
				ColorTask task = new ColorTask(rendered, individual);
				tasks.add(task);
			}
		}

		ColorTask[] taskArray = order(tasks);
		for (int i = 0; i < taskArray.length; i++) {
			if (taskArray[i].text != null) {
				int index = input.indexOf(taskArray[i].text, 0);
				while (index != -1) {
					doc.setCharacterAttributes(index, taskArray[i].text.length(), taskArray[i].set, true);
					index = input.indexOf(taskArray[i].text, index + 1);
				}
			}
		}
		tasks.clear();
	}
122410
public static <T> AddQuery<T> start(T query, long correlationId) {
        return start(query, correlationId, "default", null);
    }
957267
@SuppressWarnings("deprecation")
    protected Date getEndDate(Query query) {
        Instant instant = query.getInstantFilter("Ending");
        if (instant == null)
            return null;
        else {
            Date end = new Date(Date.from(instant).getTime() + DatabaseAccess.getDbTimeDiff());
            if (end.getHours() == 0) {
                end = new Date(end.getTime() + DAY_MS);  // end of day
            }
            return end;
        }
    }
773532
@Override
    public void setTimestamp(String parameterName, Timestamp x) throws SQLException
    {
        checkClosed();
        throw SQLError.noSupport();
    }
745780
public void setQuery(String query) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(query)) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_VALIDATE_SEARCH_QUERY_0));
        }
        m_query = query;
    }
903184
protected void bind(EbeanQueryWrapper query, Parameter parameter, Object value, int position) {
        if (parameter.isNamedParameter()) {
            query.setParameter(parameter.getName().get(), value);
        } else {
            query.setParameter(position, value);
        }
    }
81978
@Override
    public void _whereBetween(String fieldName, Object start, Object end, boolean exact) {
        fieldName = ensureValidFieldName(fieldName, false);

        List<QueryToken> tokens = getCurrentWhereTokens();
        appendOperatorIfNeeded(tokens);
        negateIfNeeded(tokens, fieldName);

        WhereParams startParams = new WhereParams();
        startParams.setValue(start);
        startParams.setFieldName(fieldName);

        WhereParams endParams = new WhereParams();
        endParams.setValue(end);
        endParams.setFieldName(fieldName);

        String fromParameterName = addQueryParameter(start == null ? "*" : transformValue(startParams, true));
        String toParameterName = addQueryParameter(end == null ? "NULL" : transformValue(endParams, true));

        WhereToken whereToken = WhereToken.create(WhereOperator.BETWEEN, fieldName, null, new WhereToken.WhereOptions(exact, fromParameterName, toParameterName));
        tokens.add(whereToken);
    }
599717
public void configureJobQuery(JobQueryImpl query) {
    configureQuery(query);
    CompositePermissionCheck permissionCheck = new PermissionCheckBuilder()
        .disjunctive()
        .atomicCheck(PROCESS_INSTANCE, "RES.PROCESS_INSTANCE_ID_", READ)
        .atomicCheck(PROCESS_DEFINITION, "RES.PROCESS_DEF_KEY_", READ_INSTANCE)
        .build();
    addPermissionCheck(query.getAuthCheck(), permissionCheck);
  }
1085265
protected void configureVariableInstanceQuery(VariableInstanceQueryImpl query) {
    configureQuery(query);

    if(query.getAuthCheck().isAuthorizationCheckEnabled()) {

      CompositePermissionCheck permissionCheck;
      if (isEnsureSpecificVariablePermission()) {
        permissionCheck = new PermissionCheckBuilder()
            .disjunctive()
            .atomicCheck(PROCESS_DEFINITION, "PROCDEF.KEY_", READ_INSTANCE_VARIABLE)
            .atomicCheck(TASK, "RES.TASK_ID_", READ_VARIABLE)
            .build();
      } else {
        permissionCheck = new PermissionCheckBuilder()
              .disjunctive()
              .atomicCheck(PROCESS_INSTANCE, "RES.PROC_INST_ID_", READ)
              .atomicCheck(PROCESS_DEFINITION, "PROCDEF.KEY_", READ_INSTANCE)
              .atomicCheck(TASK, "RES.TASK_ID_", READ)
              .build();
      }
        addPermissionCheck(query.getAuthCheck(), permissionCheck);
    }
  }
544380
protected void queryTimerEnd(String sql, long queryStartTime) {
		if ((this.queryExecuteTimeLimit != 0) 
				&& (this.connectionHook != null)){
			long timeElapsed = (System.nanoTime() - queryStartTime);
			
			if (timeElapsed > this.queryExecuteTimeLimit){
				this.connectionHook.onQueryExecuteTimeLimitExceeded(this.connectionHandle, this, sql, this.logParams, timeElapsed);
			}
		}
		
		if (this.statisticsEnabled){
			this.statistics.incrementStatementsExecuted();
			this.statistics.addStatementExecuteTime(System.nanoTime() - queryStartTime);
			
		}

	}
1336644
private AnnotationBulkDelete parseBulkDeleteQS(final HttpQuery query) {
    final AnnotationBulkDelete settings = new AnnotationBulkDelete();
    settings.start_time = query.getRequiredQueryStringParam("start_time");
    settings.end_time = query.getQueryStringParam("end_time");
    
    if (query.hasQueryStringParam("tsuids")) {
      String[] tsuids = query.getQueryStringParam("tsuids").split(",");
      settings.tsuids = new ArrayList<String>(tsuids.length);
      for (String tsuid : tsuids) {
        settings.tsuids.add(tsuid.trim());
      }
    }
    
    if (query.hasQueryStringParam("global")) {
      settings.global = true;
    }
    return settings;
  }
294174
public ResultSet executeQuery(final String query) throws SQLException {
        startTimer();
        try {
            if (queryResult != null) {
                queryResult.close();
            }
            final Query queryToSend = queryFactory.createQuery(query);
            queryResult = protocol.executeQuery(queryToSend);
            warningsCleared = false;
            return new DrizzleResultSet(queryResult, this, getProtocol());
        } catch (QueryException e) {
            throw SQLExceptionMapper.get(e);
        } finally {
            stopTimer();
        }
    }
520383
public static Long longForQuery(SQLiteConnection conn, String query, Object[] bindArgs)
            throws SQLiteException {
        SQLiteStatement stmt = null;
        try {
            stmt = conn.prepare(query);
            if (bindArgs != null && bindArgs.length > 0) {
                stmt = SQLiteWrapperUtils.bindArguments(stmt, bindArgs);
            }
            if (stmt.step()) {
                return stmt.columnLong(0);
            } else {
                throw new IllegalStateException("query failed to return any result: " + query);
            }
        } finally {
            SQLiteWrapperUtils.disposeQuietly(stmt);
        }
    }
1225859
public void setQuery(String query) throws PageException {
	this.query = Caster.toQuery(pageContext.getVariable(query));
    }