BigMemory Go 4.3.5 | Product Documentation | BigMemory Go Developer Guide | Searching with BigMemory SQL | Using the QueryManager API
 
Using the QueryManager API
The QueryManager Builder and Interface
BigMemory SQL searches are performed using the QueryManager builder and interface.
public final class QueryManagerBuilder
{
public static QueryManagerBuilder newQueryManagerBuilder()
{
}
public QueryManagerBuilder addCache(Ehcache cache)
{
}
public QueryManagerBuilder addAllCachesCurrentlyIn(CacheManager cacheManager)
{
for (String s : cacheManager.getCacheNames())
{
final Ehcache cache = cacheManager.getEhcache(s);
}
}
public QueryManager build()
{
}
}
public interface QueryManager
{
Query createQuery(String queryString);
}
Specifying Caches to Query
You can explicitly add a cache to be searched by BigMemory SQL, or you can specify the CacheManager that contains the caches. The following example does both:
QueryManager queryManager = QueryManagerBuilder
.newQueryManagerBuilder()
.addCache(cache1)
.addCache(cache2)
.addAllCachesCurrentlyIn(cacheManager1)
.addAllCachesCurrentlyIn(cacheManager2)
.build();
Note: A build of the QueryManager is a snapshot of the state of the CacheManagers and Caches. If CacheManagers or Caches are added or removed after the build, a new QueryManager should be built before issuing the query.
Specifying the Query
The createQuery() method takes one string argument that represents a BigMemory SQL SELECT clause:
Query query = queryManager.createQuery("queryString");

Copyright © 2010 - 2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release