public class QueryManagerImpl extends Object implements QueryManager
Modifier and Type | Field and Description |
---|---|
protected Map<String,InvocationEvaluator> |
inmemoryQueryMethodEvaluatorByName
Cache of InvocationEvaluator objects keyed by the "class:methodName", for use by in-memory querying.
|
protected NucleusContext |
nucleusCtx |
protected QueryCompilationCache |
queryCompilationCache
Cache for generic query compilations.
|
protected QueryDatastoreCompilationCache |
queryCompilationCacheDatastore
Cache for datastore query compilations.
|
protected Map<String,String> |
queryMethodAliasByPrefix |
protected QueryResultsCache |
queryResultsCache
Cache for query results.
|
protected StoreManager |
storeMgr |
Constructor and Description |
---|
QueryManagerImpl(NucleusContext nucleusContext,
StoreManager storeMgr) |
Modifier and Type | Method and Description |
---|---|
void |
addDatastoreQueryCompilation(String datastore,
String language,
String query,
Object compilation)
Method to store the datastore-specific compilation for a query.
|
void |
addQueryCompilation(String language,
String query,
QueryCompilation compilation)
Method to store the compilation for a query.
|
void |
addQueryResult(Query query,
Map params,
List<Object> results)
Method to store the results for a query.
|
void |
close()
Close the QueryManager, releasing all cached compilations and results.
|
void |
evictQueryResultsForType(Class cls)
Method to evict all query results for the specified candidate type.
|
Object |
getDatastoreQueryCompilation(String datastore,
String language,
String query)
Accessor for the datastore-specific compilation for a query.
|
InvocationEvaluator |
getInMemoryEvaluatorForMethod(Class type,
String methodName)
Accessor for an evaluator for invocation of the specified method for the supplied type.
|
QueryCompilationCache |
getQueryCompilationCache()
Accessor for the generic compilation cache.
|
QueryCompilation |
getQueryCompilationForQuery(String language,
String query)
Accessor for a Query compilation for the specified query and language.
|
QueryDatastoreCompilationCache |
getQueryDatastoreCompilationCache()
Accessor for the datastore compilation cache.
|
Map<String,String> |
getQueryMethodAliasesByPrefix()
Accessor for JDOQL/JPQL query method aliases keyed by the prefix.
|
List<Object> |
getQueryResult(Query query,
Map params)
Accessor for the results for a query.
|
QueryResultsCache |
getQueryResultsCache()
Accessor for the query results cache.
|
void |
removeDatastoreQueryCompilation(String datastore,
String language,
String query)
Method to remove a cached datastore query compilation.
|
void |
removeQueryCompilation(String language,
String query)
Method to remove a query compilation.
|
protected NucleusContext nucleusCtx
protected StoreManager storeMgr
protected final QueryCompilationCache queryCompilationCache
protected final QueryDatastoreCompilationCache queryCompilationCacheDatastore
protected final QueryResultsCache queryResultsCache
protected Map<String,InvocationEvaluator> inmemoryQueryMethodEvaluatorByName
public QueryManagerImpl(NucleusContext nucleusContext, StoreManager storeMgr)
public void close()
QueryManager
close
in interface QueryManager
public Map<String,String> getQueryMethodAliasesByPrefix()
QueryManager
getQueryMethodAliasesByPrefix
in interface QueryManager
public QueryCompilationCache getQueryCompilationCache()
QueryManager
getQueryCompilationCache
in interface QueryManager
public void addQueryCompilation(String language, String query, QueryCompilation compilation)
QueryManager
addQueryCompilation
in interface QueryManager
language
- Language of the queryquery
- The query stringcompilation
- The compilation of this querypublic void removeQueryCompilation(String language, String query)
QueryManager
removeQueryCompilation
in interface QueryManager
language
- The query languagequery
- The query stringpublic QueryCompilation getQueryCompilationForQuery(String language, String query)
QueryManager
getQueryCompilationForQuery
in interface QueryManager
language
- Language of the queryquery
- Query stringpublic QueryDatastoreCompilationCache getQueryDatastoreCompilationCache()
QueryManager
getQueryDatastoreCompilationCache
in interface QueryManager
public void addDatastoreQueryCompilation(String datastore, String language, String query, Object compilation)
QueryManager
addDatastoreQueryCompilation
in interface QueryManager
datastore
- The datastore identifierlanguage
- The query languagequery
- The query (string form)compilation
- The compiled informationpublic void removeDatastoreQueryCompilation(String datastore, String language, String query)
QueryManager
removeDatastoreQueryCompilation
in interface QueryManager
datastore
- The datastorelanguage
- The languagequery
- The query (string form)public Object getDatastoreQueryCompilation(String datastore, String language, String query)
QueryManager
getDatastoreQueryCompilation
in interface QueryManager
datastore
- The datastore identifierlanguage
- The query languagequery
- The query (string form)public QueryResultsCache getQueryResultsCache()
QueryManager
getQueryResultsCache
in interface QueryManager
public void evictQueryResultsForType(Class cls)
QueryManager
evictQueryResultsForType
in interface QueryManager
cls
- Candidate typepublic void addQueryResult(Query query, Map params, List<Object> results)
QueryManager
addQueryResult
in interface QueryManager
query
- The queryparams
- Map of parameter values keyed by param nameresults
- The results (List of object identities)public List<Object> getQueryResult(Query query, Map params)
QueryManager
getQueryResult
in interface QueryManager
query
- The queryparams
- Map of parameter values keyed by param namepublic InvocationEvaluator getInMemoryEvaluatorForMethod(Class type, String methodName)
QueryManager
getInMemoryEvaluatorForMethod
in interface QueryManager
type
- The class namemethodName
- Name of the methodCopyright © 2019. All rights reserved.