T
- Options typepublic abstract class AbstractQueryCallable<T extends Options> extends AbstractOperationCallable<T>
Constructor and Description |
---|
AbstractQueryCallable(Runner<T> runner,
T options)
Creates a new callable
|
Modifier and Type | Method and Description |
---|---|
QueryRun |
call()
Runs the Query counting the number of Results
|
protected long |
countResults(T options,
boolean result)
Counts the results for queries that return a boolean
|
protected long |
countResults(T options,
Model m)
Counts results for queries that return a model.
|
protected long |
countResults(T options,
ResultSet rset)
Counts results for queries that return a result set
|
protected abstract QueryExecution |
createQueryExecution(Query query)
Creates the query execution to use for the query
|
protected void |
customizeRequest(QueryExecution qe)
Provides derived implementations the option to customize the query
execution before actually executing the query e.g.
|
protected abstract Query |
getQuery()
Gets the query to be run
|
cancel, getOptions, getRunner, isCancelled
protected abstract Query getQuery()
protected long countResults(T options, boolean result)
The default implementation always returns 1
options
- Optionsresult
- Resultprotected long countResults(T options, Model m)
The default implementation returns the size of the model
options
- Optionsm
- Modelprotected long countResults(T options, ResultSet rset)
The default implementation either returns OperationRun.UNKNOWN
if
the options indicate that counting is disabled or iterates over the
results to count them.
options
- Optionsrset
- Result Setprotected void customizeRequest(QueryExecution qe)
The default implementation does nothing.
qe
- Query Executionpublic QueryRun call()
protected abstract QueryExecution createQueryExecution(Query query)
query
- QueryCopyright © 2015. All rights reserved.