public class QueryManager extends Object
Modifier and Type | Field and Description |
---|---|
protected static Localiser |
LOCALISER
Localisation of messages.
|
protected NucleusContext |
nucleusCtx |
protected StoreManager |
storeMgr |
Constructor and Description |
---|
QueryManager(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 |
addDatastoreQueryResult(Query query,
Map params,
List<Object> results)
Method to store the results for a query.
|
void |
addQueryCompilation(String language,
String query,
QueryCompilation compilation)
Method to store the compilation for a query.
|
void |
close() |
void |
deleteDatastoreQueryCompilation(String datastore,
String language,
String query)
Method to remove a cached datastore query compilation.
|
void |
evictQueryResultsForType(Class cls) |
Object |
getDatastoreQueryCompilation(String datastore,
String language,
String query)
Accessor for the datastore-specific compilation for a query.
|
List<Object> |
getDatastoreQueryResult(Query query,
Map params)
Accessor for the results 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.
|
QueryResultsCache |
getQueryResultsCache() |
protected void |
initialiseQueryCaches()
Method to find and initialise the query cache, for caching query compilations.
|
Query |
newQuery(String language,
ExecutionContext ec,
Object query)
Method to generate a new query using the passed query as basis.
|
protected static final Localiser LOCALISER
protected NucleusContext nucleusCtx
protected StoreManager storeMgr
public QueryManager(NucleusContext nucleusContext, StoreManager storeMgr)
protected void initialiseQueryCaches()
public void close()
public Query newQuery(String language, ExecutionContext ec, Object query)
language
- The query languageec
- ExecutionContextquery
- The query filter (String) or a previous Querypublic QueryCompilationCache getQueryCompilationCache()
public void addQueryCompilation(String language, String query, QueryCompilation compilation)
language
- Language of the queryquery
- The query stringcompilation
- The compilation of this querypublic QueryCompilation getQueryCompilationForQuery(String language, String query)
language
- Language of the queryquery
- Query stringpublic QueryDatastoreCompilationCache getQueryDatastoreCompilationCache()
public void addDatastoreQueryCompilation(String datastore, String language, String query, Object compilation)
datastore
- The datastore identifierlanguage
- The query languagequery
- The query (string form)compilation
- The compiled informationpublic void deleteDatastoreQueryCompilation(String datastore, String language, String query)
datastore
- The datastorelanguage
- The languagequery
- The query (string form)public Object getDatastoreQueryCompilation(String datastore, String language, String query)
datastore
- The datastore identifierlanguage
- The query languagequery
- The query (string form)public QueryResultsCache getQueryResultsCache()
public void evictQueryResultsForType(Class cls)
public void addDatastoreQueryResult(Query query, Map params, List<Object> results)
query
- The queryparams
- Map of parameter values keyed by param nameresults
- The results (List of object identities)public List<Object> getDatastoreQueryResult(Query query, Map params)
query
- The queryparams
- Map of parameter values keyed by param namepublic InvocationEvaluator getInMemoryEvaluatorForMethod(Class type, String methodName)
type
- The class namemethodName
- Name of the methodCopyright © 2021. All rights reserved.