public interface QueryContext
Modifier and Type | Method and Description |
---|---|
java.lang.Class<?> |
classForName(java.lang.String name,
java.lang.String[] imports)
Helper method to instantiate the class with the given name, taking
into account the query's candidate package, automatic imports, and
the given imports (if any).
|
void |
declareParameters(java.lang.String params)
Declared parameters, for query languages that use them.
|
java.lang.Number |
deleteInMemory(StoreQuery q,
StoreQuery.Executor ex,
java.lang.Object[] params)
Helper method to delete the objects found by executing a query on
the given executor.
|
ClassMetaData[] |
getAccessPathMetaDatas()
Return the classes that affect this query.
|
AggregateListener |
getAggregateListener(java.lang.String tag)
Return the filter listener for the given tag, or null.
|
java.util.Collection<AggregateListener> |
getAggregateListeners()
The set of aggregate listeners.
|
java.lang.String |
getAlias()
If this query is not a projection but places candidate results into a
result class under an alias, return that alias.
|
java.util.Collection<?> |
getCandidateCollection()
Return the candidate collection, or
null if an
extent was specified instead of a collection. |
java.lang.Class<?> |
getCandidateType()
Return the class of the objects that this query will return,
or
null if this information is not available / not relevant. |
java.lang.Object |
getCompilation()
Return the query's compilation state.
|
long |
getEndRange()
Return the 0-based exclusive end index for the returned results,
or
Long.MAX_VALUE for no limit. |
FetchConfiguration |
getFetchConfiguration()
Return the fetch configuration for this query.
|
FilterListener |
getFilterListener(java.lang.String tag)
Return the filter listener for the given tag, or null.
|
java.util.Collection<FilterListener> |
getFilterListeners()
The set of filter listeners.
|
boolean |
getIgnoreChanges()
Whether to ignore changes in the current transaction.
|
java.lang.String |
getLanguage()
The query language.
|
int |
getOperation()
Returns the operation that this query will be expected to perform.
|
OrderedMap<java.lang.Object,java.lang.Class<?>> |
getOrderedParameterTypes()
Return a map of parameter name to type for this query.
|
java.lang.String |
getParameterDeclaration()
The parameter declaration.
|
org.apache.commons.collections.map.LinkedMap |
getParameterTypes()
Deprecated.
|
java.lang.String[] |
getProjectionAliases()
If this query is a projection, return the projection aliases.
|
java.lang.Class<?>[] |
getProjectionTypes()
If this query is a projection, return the projection types.
|
Query |
getQuery()
Return the query for this context.
|
java.lang.String |
getQueryString()
The query string.
|
java.lang.String |
getResultMappingName()
Name of a mapping from the result data to its object representation.
|
java.lang.Class<?> |
getResultMappingScope()
Scope of a mapping from the result data to its object representation.
|
java.lang.Class<?> |
getResultType()
Returns the result class that has been set through
setResultType(java.lang.Class<?>) , or null if none. |
long |
getStartRange()
Return the 0-based start index for the returned results.
|
StoreContext |
getStoreContext()
The persistence context for the query.
|
java.util.Map<FieldMetaData,Value> |
getUpdates()
If this query is a bulk update, return a map of the
FieldMetaData s to Constant s. |
boolean |
hasGrouping()
Return true if the query uses grouping.
|
boolean |
hasSubclasses()
Whether query results will include subclasses of the candidate class.
|
boolean |
isAggregate()
Return true if the query is an aggregate.
|
boolean |
isDistinct()
Affirms if this query results are distinct instance(s).
|
boolean |
isReadOnly()
Whether the query has been marked read-only.
|
boolean |
isUnique()
The unique flag.
|
void |
lock()
Synchronize on the query's internal lock.
|
void |
setCandidateType(java.lang.Class<?> cls,
boolean subs)
Set the candidate type.
|
void |
setRange(long start,
long end)
Set the range of results to return.
|
void |
setReadOnly(boolean readOnly)
Whether the query has been marked read-only.
|
void |
setResultMapping(java.lang.Class<?> scope,
java.lang.String name)
Name and scope of a mapping from the result data to its object
representation.
|
void |
setResultType(java.lang.Class<?> cls)
Specify the type of object in which the result of evaluating this query.
|
void |
setUnique(boolean unique)
Specify that the query will return only 1
result, rather than a collection.
|
void |
unlock()
Unlock the query's internal lock.
|
java.lang.Number |
updateInMemory(StoreQuery q,
StoreQuery.Executor ex,
java.lang.Object[] params)
Helper method to update the objects found by executing a query on
the given executor.
|
Query getQuery()
StoreContext getStoreContext()
FetchConfiguration getFetchConfiguration()
int getOperation()
QueryOperations
java.lang.String getLanguage()
java.lang.String getQueryString()
java.util.Collection<?> getCandidateCollection()
null
if an
extent was specified instead of a collection.java.lang.Class<?> getCandidateType()
null
if this information is not available / not relevant.boolean hasSubclasses()
void setCandidateType(java.lang.Class<?> cls, boolean subs)
boolean isReadOnly()
void setReadOnly(boolean readOnly)
boolean isUnique()
void setUnique(boolean unique)
boolean isDistinct()
java.lang.Class<?> getResultMappingScope()
java.lang.String getResultMappingName()
void setResultMapping(java.lang.Class<?> scope, java.lang.String name)
java.lang.Class<?> getResultType()
setResultType(java.lang.Class<?>)
, or null if none.void setResultType(java.lang.Class<?> cls)
long getStartRange()
long getEndRange()
Long.MAX_VALUE
for no limit.void setRange(long start, long end)
start
- 0-based inclusive start indexend
- 0-based exclusive end index, or
Long.MAX_VALUE
for no limitjava.lang.String getParameterDeclaration()
void declareParameters(java.lang.String params)
OrderedMap<java.lang.Object,java.lang.Class<?>> getOrderedParameterTypes()
@Deprecated org.apache.commons.collections.map.LinkedMap getParameterTypes()
java.util.Map<FieldMetaData,Value> getUpdates()
FieldMetaData
s to Constant
s.boolean getIgnoreChanges()
java.lang.Object getCompilation()
java.lang.String getAlias()
java.lang.String[] getProjectionAliases()
java.lang.Class<?>[] getProjectionTypes()
boolean isAggregate()
boolean hasGrouping()
ClassMetaData[] getAccessPathMetaDatas()
FilterListener getFilterListener(java.lang.String tag)
AggregateListener getAggregateListener(java.lang.String tag)
java.util.Collection<FilterListener> getFilterListeners()
java.util.Collection<AggregateListener> getAggregateListeners()
java.lang.Number deleteInMemory(StoreQuery q, StoreQuery.Executor ex, java.lang.Object[] params)
java.lang.Number updateInMemory(StoreQuery q, StoreQuery.Executor ex, java.lang.Object[] params)
java.lang.Class<?> classForName(java.lang.String name, java.lang.String[] imports)
void lock()
void unlock()