public interface CompiledQuery extends Closeable
CompiledQuery
is a Query
which has been compiled, typically
by the data source itself, to provide optimized execution speed. Compiled
queries are produced using the DataContext.compileQuery(Query)
method.
Typically the compilation itself takes a bit of time, but firing the compiled
query is faster than regular queries. This means that for repeated executions
of the same query, it is usually faster to use compiled queries.
To make CompiledQuery
useful for more than just one specific query,
variations of the query can be fired, as long as the variations can be
expressed as a QueryParameter
for instance in the WHERE clause of the
query.DataContext.compileQuery(Query)
,
QueryParameter
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes any resources related to the compiled query.
|
List<QueryParameter> |
getParameters()
Gets the
QueryParameter s associated with the compiled query. |
String |
toSql()
A representation of the query as SQL.
|
List<QueryParameter> getParameters()
QueryParameter
s associated with the compiled query.
Values for these parameters are expected when the query is executed.String toSql()
void close()
close
in interface AutoCloseable
close
in interface Closeable
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.