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.
|
GroupBy |
groupBy(Expression... expressions)
Create and chain a GROUP BY component to group the query result.
|
Limit |
limit(Expression limit)
Create and chain a LIMIT component to limit the number query results.
|
Limit |
limit(Expression limit,
Expression offset)
Create and chain a LIMIT component 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)
Create and chain an ORDER BY component for specifying the ORDER BY clause of the query.
|
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() |
@NonNull public GroupBy groupBy(@NonNull Expression... expressions)
expressions
- The expression objects.@NonNull public OrderBy orderBy(@NonNull Ordering... orderings)
orderings
- an array of the ORDER BY expressions.@NonNull public Limit limit(@NonNull Expression limit)
limit
- The limit Expression object@NonNull public Limit limit(@NonNull Expression limit, @Nullable Expression offset)
limit
- The limit Expression objectoffset
- The offset Expression objectpublic 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.