Package com.veeva.vault.sdk.api.query
Interface Query.Builder
- Enclosing interface:
- Query
public static interface Query.Builder
-
Method Summary
Modifier and TypeMethodDescriptionappendOrderBy
(List<String> orderBy) Appends to theORDER BY
clause.appendSelect
(Collection<String> select) Appends to theSELECT
clause.appendWhere
(QueryLogicalOperator operator, String where) Appends to theWHERE
clause using the providedQueryLogicalOperator
.build()
Retrieves the completedQuery
.Sets theFIND
clause, replacing any previously set value.withFrom
(String queryTarget, QueryTargetOption... queryTargetOption) Sets the query target which appears in theFROM
clause.withMaxRows
(long maxRows) Sets theMAXROWS
clause, replacing any previously set value.withOrderBy
(List<String> orderBy) Sets theORDER BY
clause, replacing previously set values.withSelect
(Collection<String> select) Sets theSELECT
clause, replacing previously set values.withSkip
(long skip) Sets theSKIP
clause, replacing any previously set value.Sets theWHERE
clause, replacing previously set values.
-
Method Details
-
withSelect
Sets theSELECT
clause, replacing previously set values.- Parameters:
select
- terms to be used in theSELECT
clause- Returns:
- this Builder
-
appendSelect
Appends to theSELECT
clause.- Parameters:
select
- terms to append to theSELECT
clause- Returns:
- this Builder
-
withFrom
Sets the query target which appears in theFROM
clause. This call replaces previously set values. Optional:QueryTargetOption
(s) set the scope of the query target.- Parameters:
queryTarget
- target of the queryqueryTargetOption
- option(s) to apply to the query target- Returns:
- this Builder
-
withFind
Sets theFIND
clause, replacing any previously set value. The providedfind
will be wrapped in parentheses.For example, to generate:
Use:FIND ( 'tylenol' SCOPE ALL )
withFind("'tylenol' SCOPE ALL")
- Parameters:
find
-FIND
clause- Returns:
- this Builder
-
withWhere
Sets theWHERE
clause, replacing previously set values.- Parameters:
where
-WHERE
clause- Returns:
- this Builder
-
appendWhere
Appends to theWHERE
clause using the providedQueryLogicalOperator
. Parentheses will be inserted to preserve the logic of any previously setWHERE
clause.For example, the following code:
Will produce thequeryBuilder.withWhere("name__v = 'VeevaProm'", "OR name__v = 'Cholecap'"); queryBuilder.appendWhere(QueryLogicalOperator.AND, "status__v = 'active'");
WHERE
clause:WHERE ( name__v = 'VeevaProm' OR name__v = 'Cholecap' ) AND ( status__v = 'active' )
If no
WHERE
clause was previously set, theoperator
is ignored.- Parameters:
operator
- logical operator with which to append thisWHERE
clausewhere
-WHERE
clause- Returns:
- this Builder
-
withOrderBy
Sets theORDER BY
clause, replacing previously set values.- Parameters:
orderBy
- terms to be used in theORDER BY
clause- Returns:
- this Builder
-
appendOrderBy
Appends to theORDER BY
clause.- Parameters:
orderBy
- terms to append to theORDER BY
clause- Returns:
- this Builder
-
withMaxRows
Sets theMAXROWS
clause, replacing any previously set value.- Parameters:
maxRows
- value for theMAXROWS
clause- Returns:
- this Builder
-
withSkip
Sets theSKIP
clause, replacing any previously set value.- Parameters:
skip
- value for theSKIP
clause- Returns:
- this Builder
-
build
Query build()Retrieves the completedQuery
.The
SELECT
andFROM
clauses must not be empty.- Returns:
- the completed Query
-