org.eobjects.metamodel.query
Interface CompiledQuery

All Superinterfaces:
Closeable
All Known Implementing Classes:
DefaultCompiledQuery

public interface CompiledQuery
extends Closeable

A 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.

See Also:
DataContext.compileQuery(Query), QueryParameter

Method Summary
 void close()
          Closes any resources related to the compiled query.
 List<QueryParameter> getParameters()
          Gets the QueryParameters associated with the compiled query.
 String toSql()
          A representation of the query as SQL.
 

Method Detail

getParameters

List<QueryParameter> getParameters()
Gets the QueryParameters associated with the compiled query. Values for these parameters are expected when the query is executed.

Returns:
a list of query parameters

toSql

String toSql()
A representation of the query as SQL.

Returns:
a SQL string.

close

void close()
Closes any resources related to the compiled query.

Specified by:
close in interface Closeable


Copyright © 2007-2013. All Rights Reserved.