Modifier and Type | Method and Description |
---|---|
ListenerToken |
addChangeListener(Executor executor,
QueryChangeListener listener)
Adds a query change listener with the dispatch queue on which changes
will be posted.
|
ListenerToken |
addChangeListener(QueryChangeListener listener)
Adds a query change listener.
|
ResultSet |
execute()
Executes the query.
|
String |
explain()
Returns a string describing the implementation of the compiled query.
|
Parameters |
getParameters()
Returns a copies of the current parameters.
|
Limit |
limit(Expression limit)
Creates and chains a Limit object to limit the number query results.
|
Limit |
limit(Expression limit,
Expression offset)
Creates and chains a Limit object to skip the returned results for the given offset
position and to limit the number of results to not more than the given limit value.
|
OrderBy |
orderBy(Ordering... orderings)
Creates and chains an OrderBy object for specifying the orderings of the query result.
|
void |
removeChangeListener(ListenerToken token)
Removes a change listener wih the given listener token.
|
void |
setParameters(Parameters parameters)
Set parameters should copy the given parameters.
|
String |
toString() |
Where |
where(Expression expression)
Creates and chains a Where object for specifying the WHERE clause of the query.
|
@NonNull public Where where(@NonNull Expression expression)
expression
- The where expression.@NonNull public OrderBy orderBy(@NonNull Ordering... orderings)
orderings
- The Ordering objects.@NonNull public Limit limit(@NonNull Expression limit)
limit
- The limit expression.@NonNull public Limit limit(@NonNull Expression limit, @Nullable Expression offset)
limit
- The limit expression.offset
- The offset expression.public Parameters getParameters()
getParameters
in interface Query
public void setParameters(Parameters parameters)
setParameters
in interface Query
@NonNull public ResultSet execute() throws CouchbaseLiteException
The results come from a snapshot of the database taken at the moment the run() method is called, so they will not reflect any changes made to the database afterwards.
execute
in interface Query
CouchbaseLiteException
- if there is an error when running the query.@NonNull public String explain() throws CouchbaseLiteException
explain
in interface Query
CouchbaseLiteException
- if an error occurs@NonNull public ListenerToken addChangeListener(@NonNull QueryChangeListener listener)
addChangeListener
in interface Query
listener
- The listener to post changes.@NonNull public ListenerToken addChangeListener(Executor executor, @NonNull QueryChangeListener listener)
addChangeListener
in interface Query
executor
- The executor object that calls listener. If null, use default executor.listener
- The listener to post changes.public void removeChangeListener(@NonNull ListenerToken token)
removeChangeListener
in interface Query
token
- The listener token.