@API.Public @API.ImmutableOnBuild public interface Query extends Buildable, Container, JsonString
Modifier and Type | Field and Description |
---|---|
static String |
LIMIT
OJAI field name for the
limit(long) operator |
static String |
OFFSET
OJAI field name for the
offset(long) operator |
static String |
ORDERBY
OJAI field name for the
orderBy(FieldPath...) operator |
static String |
SELECT
OJAI field name for the
select(FieldPath...) operator. |
static String |
WHERE
OJAI field name for the
where(QueryCondition) operator |
Modifier and Type | Method and Description |
---|---|
Query |
build()
Builds this Query object and make it immutable.
|
Object |
getOption(String optionName)
Returns the value of the named query option.
|
Query |
limit(long limit)
Restricts the maximum number of documents returned from this query
to the specified value.
|
Query |
offset(long offset)
Zero (0) based index which specifies number of Documents to skip before
returning any result. |
Query |
orderBy(FieldPath... fieldPaths)
Sets the sort ordering of the returned Documents to the ascending order of specified field paths.
|
Query |
orderBy(FieldPath field,
SortOrder order)
Sets the sort ordering of the returned Documents to the specified field and order.
|
Query |
orderBy(String... fieldPaths)
Sets the sort ordering of the returned Documents to the ascending order of specified field paths.
|
Query |
orderBy(String field,
SortOrder order)
Sets the sort ordering of the returned Documents to the specified field and order.
|
Query |
orderBy(String field,
String order)
Sets the sort ordering of the returned Documents to the specified field and order.
|
Query |
select(FieldPath... fieldPaths)
Adds the list of field paths to the list of projected fields.
|
Query |
select(String... fieldPaths)
Adds the list of field paths to the list of projected fields.
|
Query |
setOption(String optionName,
Object value)
Sets a named query option.
|
Query |
setOptions(Document options)
Sets multiple query options for this Query.
|
Query |
setTimeout(long timeoutInMilliseconds)
Sets a duration after which the query will fails with
QueryTimeoutException . |
Query |
waitForTrackedWrites(String writesContext)
Sets the writes-context for this query.
|
Query |
where(QueryCondition condition)
Sets the filtering condition for the query.
|
Query |
where(String conditionJson)
Sets the filtering condition for the query.
|
empty, isEmpty, isReadOnly, size
asJsonString, asJsonString
static final String SELECT
select(FieldPath...)
operator.static final String ORDERBY
orderBy(FieldPath...)
operatorstatic final String WHERE
where(QueryCondition)
operatorstatic final String LIMIT
limit(long)
operatorstatic final String OFFSET
offset(long)
operatorQuery setOption(@API.NonNullable String optionName, @API.NonNullable Object value) throws IllegalArgumentException
this
for chained invocationIllegalArgumentException
Object getOption(@API.NonNullable String optionName)
null
if no such option existQuery setOptions(@API.Nullable Document options) throws IllegalArgumentException
this
for chained invocationIllegalArgumentException
Query setTimeout(long timeoutInMilliseconds) throws IllegalArgumentException
QueryTimeoutException
.
A query timeout occurs when the specified time has passed since a query response was requested,
either by calling Iterator.next()
on iterator of query's DocumentStream
,
or between successive callback of DocumentListener.documentArrived(Document)
.this
for chained invocationIllegalArgumentException
- If the timeout value is negativeQuery waitForTrackedWrites(@API.NonNullable String writesContext) throws IllegalArgumentException
DocumentStore
.this
for chained invocationNullPointerException
- if the commit context is null
IllegalArgumentException
- if the specified writes-context can not be parsedDocumentStore.beginTrackingWrites()
,
DocumentStore.beginTrackingWrites(String)
,
DocumentStore.endTrackingWrites()
Query select(@API.NonNullable String... fieldPaths) throws IllegalArgumentException
this
for chained invocationIllegalArgumentException
Query select(@API.NonNullable FieldPath... fieldPaths) throws IllegalArgumentException
this
for chained invocationIllegalArgumentException
Query where(@API.NonNullable String conditionJson) throws OjaiException, IllegalArgumentException
this
for chained invocationOjaiException
IllegalArgumentException
Query where(@API.NonNullable QueryCondition condition) throws OjaiException, IllegalArgumentException
this
for chained invocationOjaiException
IllegalArgumentException
Query orderBy(@API.NonNullable String... fieldPaths) throws IllegalArgumentException
this
for chained invocationIllegalArgumentException
- if the same field is specified more than onceQuery orderBy(@API.NonNullable FieldPath... fieldPaths) throws IllegalArgumentException
this
for chained invocationIllegalArgumentException
- if the same field is specified more than onceQuery orderBy(@API.NonNullable String field, @API.NonNullable String order) throws IllegalArgumentException
this
for chained invocationIllegalArgumentException
- if the same field is specified more than onceIllegalArgumentException
- if the supplied field path can not be parsed or
order is neither "ASC" or "DESC", ignoring caseQuery orderBy(@API.NonNullable String field, @API.NonNullable SortOrder order) throws IllegalArgumentException
this
for chained invocationIllegalArgumentException
- if the same field is specified more than onceQuery orderBy(@API.NonNullable FieldPath field, @API.NonNullable SortOrder order) throws IllegalArgumentException
this
for chained invocationIllegalArgumentException
- if the same field is specified more than onceQuery offset(long offset) throws IllegalArgumentException
Zero
(0) based index which specifies number of Documents to skip before
returning any result. Negative values are not permitted.
Multiple invocation will overwrite the previous value.this
for chained invocationIllegalArgumentException
Query limit(long limit) throws IllegalArgumentException
this
for chained invocationIllegalArgumentException
Copyright © 2015–2019 MapR Technologies, Inc.. All rights reserved.