public class PreparedQueryImpl extends Object implements PreparedQuery
PreparedQuery
for SQL queries.
PreparedQuery holds the post-compilation and post-execution state of a kernel Query.
The post-execution internal state of a query is appended as a user object
to the user-visible result to maintain the API contract.Constructor and Description |
---|
PreparedQueryImpl(String id,
Query compiled)
Construct.
|
PreparedQueryImpl(String id,
String sql,
Query compiled)
Construct.
|
Modifier and Type | Method and Description |
---|---|
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 which is same as the identifier of this
receiver.
|
Class[] |
getProjectionTypes() |
QueryExpressions[] |
getQueryExpressions() |
String |
getTargetQuery()
Get the target database query.
|
PreparedQueryCache.Exclusion |
initialize(Object result)
Initialize this receiver with post-execution result.
|
boolean |
isInitialized()
Affirms if this receiver has been initialized.
|
Map<Integer,Object> |
reparametrize(Map user,
Broker broker)
Merge the given user parameters with its own parameter.
|
void |
setInto(Query q)
Pours the post-compilation state held by this receiver to the given
query.
|
String |
toString() |
public PreparedQueryImpl(String id, Query compiled)
id
- an identifier for this query to be used as cache keycompiled
- a compiled querypublic String getIdentifier()
PreparedQuery
cache
.getIdentifier
in interface PreparedQuery
public String getLanguage()
PreparedQuery
getLanguage
in interface PreparedQuery
public String getOriginalQuery()
getOriginalQuery
in interface PreparedQuery
public String getTargetQuery()
PreparedQuery
getTargetQuery
in interface PreparedQuery
public boolean isInitialized()
PreparedQuery
isInitialized
in interface PreparedQuery
public QueryExpressions[] getQueryExpressions()
public Class[] getProjectionTypes()
public void setInto(Query q)
setInto
in interface PreparedQuery
q
- A Query which has been substituted by this receiver and hence
does not have its post-compilation state.public PreparedQueryCache.Exclusion initialize(Object result)
ResultList
with
an attached SelectResultObjectProvider
as its
user object
.initialize
in interface PreparedQuery
result
- an opaque instance supposed to carry post-execution data such
as target database query, parameters of the query etc.public Map<Integer,Object> reparametrize(Map user, Broker broker)
initialization
.reparametrize
in interface PreparedQuery
user
- the map of parameter key and value set by the user on the
original query.Copyright © 2006–2022 Apache Software Foundation. All rights reserved.