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.
|
From |
from(DataSource dataSource)
Create and chain a FROM component for specifying the data source of the query.
|
Parameters |
getParameters()
Returns a copies of the current parameters.
|
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 From from(@NonNull DataSource dataSource)
dataSource
- the data source.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.