|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.solarmetric.kodo.runtime.datacache.query.CacheAwareQuery
A Query implementation that caches the OIDs involved in
the query, and can determine whether or not the query has been
dirtied.
| Inner Class Summary | |
(package private) static class |
CacheAwareQuery.CachedResultList
|
| Fields inherited from interface com.solarmetric.kodo.query.KodoQuery |
FLUSH_ALWAYS, FLUSH_ALWAYS_MODE, FLUSH_NEVER, FLUSH_NEVER_MODE, FLUSH_WITH_CONNECTION, FLUSH_WITH_CONNECTION_MODE |
| Constructor Summary | |
CacheAwareQuery(com.solarmetric.kodo.query.KodoQuery query,
DataCacheStoreManager store)
Create a new CacheAwareQuery that delegates to
query if no cached results are available. |
|
| Method Summary | |
void |
abortCaching()
Instructs this query to notify all CachingList objects
created by it to stop caching results. |
protected ResultList |
checkCache(QueryKey qk)
Look in the query cache for a result for the given query key. |
void |
close(Object arg)
|
void |
closeAll()
|
void |
compile()
|
void |
declareImports(String arg)
|
void |
declareParameters(String arg)
|
void |
declareVariables(String arg)
|
Object |
execute()
|
Object |
execute(Object arg)
|
Object |
execute(Object arg0,
Object arg1)
|
Object |
execute(Object arg0,
Object arg1,
Object arg2)
|
Object |
executeWithArray(Object[] args)
|
Object |
executeWithMap(Map args)
|
Set |
getAccessPathClasses()
|
QueryCache |
getCache()
Return the QueryCache that this object is associated
with. |
Class |
getCandidateClass()
|
Collection |
getCandidateCollection()
|
Extent |
getCandidateExtent()
|
com.solarmetric.kodo.query.KodoQuery |
getDelegate()
Returns the query that is being cached. |
String |
getFilter()
|
int |
getFlushBeforeQueries()
|
boolean |
getIgnoreCache()
|
String |
getOrdering()
|
String[][] |
getParameterDeclarations()
|
PersistenceManager |
getPersistenceManager()
|
boolean |
getQueryCacheEnabled()
|
void |
setCandidates(Collection arg)
|
void |
setCandidates(Extent arg)
|
void |
setClass(Class arg)
|
void |
setFilter(String arg)
|
void |
setFlushBeforeQueries(int flushBeforeQueries)
|
void |
setIgnoreCache(boolean arg)
|
void |
setOrdering(String arg)
|
void |
setQueryCacheEnabled(boolean arg)
|
protected ResultList |
wrapList(Object o,
QueryKey qk)
Wrap the query result list in a list that will cache the values upon completion of the traversal of the underlying list. |
Object |
writeReplace()
Serialize the delegate query, not the cache-aware query. |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public CacheAwareQuery(com.solarmetric.kodo.query.KodoQuery query,
DataCacheStoreManager store)
CacheAwareQuery that delegates to
query if no cached results are available.| Method Detail |
protected ResultList checkCache(QueryKey qk)
Look in the query cache for a result for the given query key. Only look if this query is being executed outside a transaction or in a transaction with IgnoreCache set to true or in a transaction with IgnoreCache set to false but in which none of the classes involved in this query have been touched.
Caching is not used when using pessimistic transactions. This is because we must obtain locks on the data, and it is likely that making n trips to the database to make the locks will be slower than running the query against the database.
If KodoQuery.getQueryCacheEnabled() returns
false, this method returns null.
Return the list if we meet the above criteria and if a list
is found for qk. Else, return
null.
This implementation means that queries against the cache are of READ_COMMITTED isolation level. It'd be nice to support READ_SERIALIZABLE -- to do so, we'd just return false when in a transaction.
protected ResultList wrapList(Object o,
QueryKey qk)
Wrap the query result list in a list that will cache the values upon completion of the traversal of the underlying list.
This list must not register its results with the cache if one of the classes involved in this query is touched during the traversal of the query.
This method may decide not to do any caching of the query identified. For example, it might just return the supplied list if the query involves classes that are not cacheable.
public QueryCache getCache()
QueryCache that this object is associated
with.public void abortCaching()
CachingList objects
created by it to stop caching results. Upon invoking this
method, all caching efforts are aborted, and any partial
results are dropped.public com.solarmetric.kodo.query.KodoQuery getDelegate()
public void setClass(Class arg)
setClass in interface Querypublic void setCandidates(Extent arg)
setCandidates in interface Querypublic void setCandidates(Collection arg)
setCandidates in interface Querypublic void setFilter(String arg)
setFilter in interface Querypublic void declareImports(String arg)
declareImports in interface Querypublic void declareParameters(String arg)
declareParameters in interface Querypublic void declareVariables(String arg)
declareVariables in interface Querypublic void setOrdering(String arg)
setOrdering in interface Querypublic void setIgnoreCache(boolean arg)
setIgnoreCache in interface Querypublic boolean getIgnoreCache()
getIgnoreCache in interface Querypublic void compile()
compile in interface Querypublic Object execute()
execute in interface Querypublic Object execute(Object arg)
execute in interface Query
public Object execute(Object arg0,
Object arg1)
execute in interface Query
public Object execute(Object arg0,
Object arg1,
Object arg2)
execute in interface Querypublic Object executeWithMap(Map args)
executeWithMap in interface Querypublic Object executeWithArray(Object[] args)
executeWithArray in interface Querypublic PersistenceManager getPersistenceManager()
getPersistenceManager in interface Querypublic void close(Object arg)
close in interface Querypublic void closeAll()
closeAll in interface Querypublic String[][] getParameterDeclarations()
getParameterDeclarations in interface com.solarmetric.kodo.query.KodoQuerypublic Set getAccessPathClasses()
getAccessPathClasses in interface com.solarmetric.kodo.query.KodoQuerypublic Extent getCandidateExtent()
getCandidateExtent in interface com.solarmetric.kodo.query.KodoQuerypublic Collection getCandidateCollection()
getCandidateCollection in interface com.solarmetric.kodo.query.KodoQuerypublic Class getCandidateClass()
getCandidateClass in interface com.solarmetric.kodo.query.KodoQuerypublic String getFilter()
getFilter in interface com.solarmetric.kodo.query.KodoQuerypublic String getOrdering()
getOrdering in interface com.solarmetric.kodo.query.KodoQuerypublic void setQueryCacheEnabled(boolean arg)
setQueryCacheEnabled in interface com.solarmetric.kodo.query.KodoQuerypublic boolean getQueryCacheEnabled()
getQueryCacheEnabled in interface com.solarmetric.kodo.query.KodoQuerypublic void setFlushBeforeQueries(int flushBeforeQueries)
setFlushBeforeQueries in interface com.solarmetric.kodo.query.KodoQuerypublic int getFlushBeforeQueries()
getFlushBeforeQueries in interface com.solarmetric.kodo.query.KodoQuery
public Object writeReplace()
throws ObjectStreamException
|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||