public static interface Query.Builder
Modifier and Type | Method and Description |
---|---|
Query.Builder |
appendOrderBy(List<String> orderBy)
Appends to the
ORDER BY clause. |
Query.Builder |
appendSelect(Collection<String> select)
Appends to the
SELECT clause. |
Query.Builder |
appendWhere(QueryLogicalOperator operator,
String where)
Appends to the
WHERE clause using the provided QueryLogicalOperator . |
Query |
build()
Retrieves the completed
Query . |
Query.Builder |
withFind(String find)
Sets the
FIND clause, replacing any previously set value. |
Query.Builder |
withFrom(String queryTarget,
QueryTargetOption... queryTargetOption)
Sets the query target which appears in the
FROM clause. |
Query.Builder |
withMaxRows(long maxRows)
Sets the
MAXROWS clause, replacing any previously set value. |
Query.Builder |
withOrderBy(List<String> orderBy)
Sets the
ORDER BY clause, replacing previously set values. |
Query.Builder |
withSelect(Collection<String> select)
Sets the
SELECT clause, replacing previously set values. |
Query.Builder |
withSkip(long skip)
Sets the
SKIP clause, replacing any previously set value. |
Query.Builder |
withWhere(String where)
Sets the
WHERE clause, replacing previously set values. |
Query.Builder withSelect(Collection<String> select)
SELECT
clause, replacing previously set values.select
- terms to be used in the SELECT
clauseQuery.Builder appendSelect(Collection<String> select)
SELECT
clause.select
- terms to append to the SELECT
clauseQuery.Builder withFrom(String queryTarget, QueryTargetOption... queryTargetOption)
FROM
clause. This call replaces
previously set values.
Optional: QueryTargetOption
(s) set the scope of the query target.queryTarget
- target of the queryqueryTargetOption
- option(s) to apply to the query targetQuery.Builder withFind(String find)
FIND
clause, replacing any previously set value.
The provided find
will be wrapped in parentheses.
For example, to generate:
FIND ( 'tylenol' SCOPE ALL )
Use:
withFind("'tylenol' SCOPE ALL")
find
- FIND
clauseQuery.Builder withWhere(String where)
WHERE
clause, replacing previously set values.where
- WHERE
clauseQuery.Builder appendWhere(QueryLogicalOperator operator, String where)
WHERE
clause using the provided QueryLogicalOperator
.
Parentheses will be inserted to preserve the logic of any previously set WHERE
clause.
For example, the following code:
queryBuilder.withWhere("name__v = 'VeevaProm'", "OR name__v = 'Cholecap'");
queryBuilder.appendWhere(QueryLogicalOperator.AND, "status__v = 'active'");
Will produce the WHERE
clause:
WHERE ( name__v = 'VeevaProm' OR name__v = 'Cholecap' ) AND ( status__v = 'active' )
If no WHERE
clause was previously set, the operator
is ignored.
operator
- logical operator with which to append this WHERE
clausewhere
- WHERE
clauseQuery.Builder withOrderBy(List<String> orderBy)
ORDER BY
clause, replacing previously set values.orderBy
- terms to be used in the ORDER BY
clauseQuery.Builder appendOrderBy(List<String> orderBy)
ORDER BY
clause.orderBy
- terms to append to the ORDER BY
clauseQuery.Builder withMaxRows(long maxRows)
MAXROWS
clause, replacing any previously set value.maxRows
- value for the MAXROWS
clauseQuery.Builder withSkip(long skip)
SKIP
clause, replacing any previously set value.skip
- value for the SKIP
clauseCopyright © Veeva Systems 2017–2022. All rights reserved.