|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PreparedQuery
A prepared query associates a compiled query to a parsed state that
can be executed possibly with more efficiency. An obvious example is to
associate a compiled query to an executable SQL string.
The query expressed in target language can be executed directly bypassing
the critical translation cost to the data store target language on every
execution.
As the subsequent execution of a cached query will bypass normal query
compilation, the post-compilation state of the original query is captured by
this receiver to be transferred to the executable query instance.
This receiver must not hold any context-sensitive reference or dependency.
Because the whole idea of preparing a query (for a cost) is to be able to
execute the same logical query in different persistence contexts. However,
a prepared query may not be valid when some parameters of execution context
such as lock group or fetch plan changes in a way that will change the target
query. Refer to PreparedQueryCache
for invalidation mechanism on
possible actions under such circumstances.
The query execution model does account for context changes that do
not impact the target query e.g. bind variables.
Method Summary | |
---|---|
String |
getIdentifier()
Get the immutable identifier of this receiver used for * cache . |
String |
getLanguage()
Gets the language in which this query is expressed. |
String |
getOriginalQuery()
Get the original query. |
String |
getTargetQuery()
Get the target database query. |
PreparedQueryCache.Exclusion |
initialize(Object o)
Initialize from the given argument. |
boolean |
isInitialized()
Affirms if this receiver has been initialized. |
Map |
reparametrize(Map user,
Broker broker)
Get the list of parameters in a map where an entry represents a parameter key and value after replacing with the given user parameters. |
void |
setInto(Query q)
Fill in the post-compilation state of the given Query. |
Method Detail |
---|
String getIdentifier()
cache
.
String getTargetQuery()
String getOriginalQuery()
String getLanguage()
void setInto(Query q)
q
- A Query which has been substituted by this receiver and hence
does not have its post-compilation state.PreparedQueryCache.Exclusion initialize(Object o)
o
- an opaque instance supposed to carry post-execution data such
as target database query, parameters of the query etc.
boolean isInitialized()
Map reparametrize(Map user, Broker broker)
user
- the map of parameter key and value set by the user on the
original query.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |