Package org.datanucleus.store.query
Interface QueryManager
-
- All Known Implementing Classes:
FederatedQueryManagerImpl,QueryManagerImpl
public interface QueryManagerInterface providing a way of creating instances of queries for datastores, caching of generic and datastore compilations, as well as caching query results.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddDatastoreQueryCompilation(java.lang.String datastore, java.lang.String language, java.lang.String query, java.lang.Object compilation)Method to store the datastore-specific compilation for a query.voidaddQueryCompilation(java.lang.String language, java.lang.String query, QueryCompilation compilation)Method to store the compilation for a query.voidaddQueryResult(Query query, java.util.Map params, java.util.List<java.lang.Object> results)Method to store the results for a query.voidclose()Close the QueryManager, releasing all cached compilations and results.voidevictQueryResultsForType(java.lang.Class cls)Method to evict all query results for the specified candidate type.java.lang.ObjectgetDatastoreQueryCompilation(java.lang.String datastore, java.lang.String language, java.lang.String query)Accessor for the datastore-specific compilation for a query.InvocationEvaluatorgetInMemoryEvaluatorForMethod(java.lang.Class type, java.lang.String methodName)Accessor for an evaluator for invocation of the specified method for the supplied type.QueryCompilationCachegetQueryCompilationCache()Accessor for the generic compilation cache.QueryCompilationgetQueryCompilationForQuery(java.lang.String language, java.lang.String query)Accessor for a Query compilation for the specified query and language.QueryDatastoreCompilationCachegetQueryDatastoreCompilationCache()Accessor for the datastore compilation cache.java.util.Map<java.lang.String,java.lang.String>getQueryMethodAliasesByPrefix()Accessor for JDOQL/JPQL query method aliases keyed by the prefix.java.util.List<java.lang.Object>getQueryResult(Query query, java.util.Map params)Accessor for the results for a query.QueryResultsCachegetQueryResultsCache()Accessor for the query results cache.voidremoveDatastoreQueryCompilation(java.lang.String datastore, java.lang.String language, java.lang.String query)Method to remove a cached datastore query compilation.voidremoveQueryCompilation(java.lang.String language, java.lang.String query)Method to remove a query compilation.
-
-
-
Method Detail
-
close
void close()
Close the QueryManager, releasing all cached compilations and results.
-
getQueryCompilationCache
QueryCompilationCache getQueryCompilationCache()
Accessor for the generic compilation cache.- Returns:
- The cache of generic compilations
-
addQueryCompilation
void addQueryCompilation(java.lang.String language, java.lang.String query, QueryCompilation compilation)Method to store the compilation for a query.- Parameters:
language- Language of the queryquery- The query stringcompilation- The compilation of this query
-
removeQueryCompilation
void removeQueryCompilation(java.lang.String language, java.lang.String query)Method to remove a query compilation.- Parameters:
language- The query languagequery- The query string
-
getQueryCompilationForQuery
QueryCompilation getQueryCompilationForQuery(java.lang.String language, java.lang.String query)
Accessor for a Query compilation for the specified query and language.- Parameters:
language- Language of the queryquery- Query string- Returns:
- The compilation (if present)
-
getQueryDatastoreCompilationCache
QueryDatastoreCompilationCache getQueryDatastoreCompilationCache()
Accessor for the datastore compilation cache.- Returns:
- The cache of datastore compilations
-
getDatastoreQueryCompilation
java.lang.Object getDatastoreQueryCompilation(java.lang.String datastore, java.lang.String language, java.lang.String query)Accessor for the datastore-specific compilation for a query.- Parameters:
datastore- The datastore identifierlanguage- The query languagequery- The query (string form)- Returns:
- The compiled information (if available)
-
addDatastoreQueryCompilation
void addDatastoreQueryCompilation(java.lang.String datastore, java.lang.String language, java.lang.String query, java.lang.Object compilation)Method to store the datastore-specific compilation for a query.- Parameters:
datastore- The datastore identifierlanguage- The query languagequery- The query (string form)compilation- The compiled information
-
removeDatastoreQueryCompilation
void removeDatastoreQueryCompilation(java.lang.String datastore, java.lang.String language, java.lang.String query)Method to remove a cached datastore query compilation.- Parameters:
datastore- The datastorelanguage- The languagequery- The query (string form)
-
getQueryResultsCache
QueryResultsCache getQueryResultsCache()
Accessor for the query results cache.- Returns:
- Query results cache (if present)
-
getQueryResult
java.util.List<java.lang.Object> getQueryResult(Query query, java.util.Map params)
Accessor for the results for a query.- Parameters:
query- The queryparams- Map of parameter values keyed by param name- Returns:
- The results (List of object identities)
-
evictQueryResultsForType
void evictQueryResultsForType(java.lang.Class cls)
Method to evict all query results for the specified candidate type.- Parameters:
cls- Candidate type
-
addQueryResult
void addQueryResult(Query query, java.util.Map params, java.util.List<java.lang.Object> results)
Method to store the results for a query.- Parameters:
query- The queryparams- Map of parameter values keyed by param nameresults- The results (List of object identities)
-
getInMemoryEvaluatorForMethod
InvocationEvaluator getInMemoryEvaluatorForMethod(java.lang.Class type, java.lang.String methodName)
Accessor for an evaluator for invocation of the specified method for the supplied type. If it is not a supported method for that type then returns null.- Parameters:
type- The class namemethodName- Name of the method- Returns:
- Evaluator suitable for this type with this method name
-
getQueryMethodAliasesByPrefix
java.util.Map<java.lang.String,java.lang.String> getQueryMethodAliasesByPrefix()
Accessor for JDOQL/JPQL query method aliases keyed by the prefix.- Returns:
- The method aliases map
-
-