|
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.query.QueryImpl
Abstract implementation of the Query interface.
| Inner Class Summary | |
(package private) class |
QueryImpl.AggregateQueryExecutor
An AggregateQueryExecutor executes multiple Queries and returns a MergedResultList with the appropriate ordering (if more than one query needs to be executed). |
(package private) class |
QueryImpl.DatastoreQueryExecutor
The DatastoreQueryExecutor executes the query against the implementation's overridden QueryImpl.DatastoreQueryExecutor.executeQuery(java.util.Map) method. |
(package private) class |
QueryImpl.InMemoryQueryExecutor
The InMemoryQueryExecutor evaluates an InMemoryExpression against either a candidate collection or an Extent. |
(package private) static interface |
QueryImpl.ParsedExpression
A ParsedExpression represents either an in-memory or implementation-specific parsed expression. |
(package private) class |
QueryImpl.QueryExecutionManager
The QueryExecutionManager handles caching a parsed expression, and aggregating multiple query execution results. |
(package private) static interface |
QueryImpl.QueryExecutor
A QueryExecutor provides a uniform interface to the mechanism for executing either a in-memory or datasource Query. |
static class |
QueryImpl.QueryResultComparator
A Comparator implementation that performs the comparison
based on the ordering specification of the QueryImpl. |
| 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 | |
QueryImpl(PersistenceManagerImpl pm)
Construct a query managed by the given persistence manager. |
|
QueryImpl(PersistenceManagerImpl pm,
Object copy)
Construct a query managed by the given persistence manager, copying the candidate class, filter, parameters, variables, ordering, and options from the given query. |
|
| Method Summary | |
Class |
classForName(String name)
|
protected abstract void |
close(List result)
Close the given query result. |
void |
close(Object queryResult)
Close the given query result. |
void |
closeAll()
Close all query results. |
void |
compile()
|
void |
declareImports(String imports)
|
void |
declareParameters(String parameters)
|
void |
declareVariables(String variables)
|
Object |
execute()
|
Object |
execute(Object p1)
|
Object |
execute(Object p1,
Object p2)
|
Object |
execute(Object p1,
Object p2,
Object p3)
|
protected abstract ResultList |
executeQuery(ClassMetaData type,
boolean subclasses,
com.solarmetric.kodo.query.ExpressionFactory factory,
com.solarmetric.kodo.query.Expression exp,
Map params)
Execute the given expression against the given candidate extent. |
Object |
executeWithArray(Object[] params)
|
Object |
executeWithMap(Map params)
|
Set |
getAccessPathClasses()
|
Class |
getCandidateClass()
|
Collection |
getCandidateCollection()
|
Extent |
getCandidateExtent()
|
protected abstract com.solarmetric.kodo.query.ExpressionFactory |
getExpressionFactory(ClassMetaData type)
Return an ExpressionFactory to use to create an expression to
be executed against an extent. |
String |
getFilter()
|
FilterListener |
getFilterListener(String tag)
|
int |
getFlushBeforeQueries()
|
boolean |
getIgnoreCache()
|
String |
getOrdering()
|
Comparator |
getOrderingComparator()
Returns a QueryImpl.QueryResultComparator that is able to order individual
items in the list according to the
setOrdering(java.lang.String) specification. |
Class |
getParameterClass(String name)
|
String[][] |
getParameterDeclarations()
|
PersistenceManager |
getPersistenceManager()
|
boolean |
getQueryCacheEnabled()
|
boolean |
getSortDirection(int orderingIndex)
|
protected abstract FilterListener |
getStandardFilterListener(String tag)
Return the standard filter extension for the given tag, or null if none. |
Class |
getVariableClass(String name)
|
boolean |
isParameter(String name)
|
boolean |
isVariable(String name)
|
protected void |
lock()
Synchronizes on an internal lock if the Multithreaded
flat is set in the persistence manager. |
void |
registerListener(FilterListener listener)
Register a filter listener for this particular query. |
void |
setCandidates(Collection candidateCollection)
|
void |
setCandidates(Extent candidateExtent)
|
void |
setClass(Class candidateClass)
|
void |
setFilter(String filter)
|
void |
setFlushBeforeQueries(int flush)
|
void |
setIgnoreCache(boolean flag)
|
void |
setOrdering(String ordering)
|
void |
setQueryCacheEnabled(boolean enabled)
|
String |
toString()
|
protected void |
unlock()
Releases the internal lock. |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public QueryImpl(PersistenceManagerImpl pm)
public QueryImpl(PersistenceManagerImpl pm,
Object copy)
| Method Detail |
public PersistenceManager getPersistenceManager()
getPersistenceManager in interface Querypublic void setClass(Class candidateClass)
setClass in interface Querypublic void setCandidates(Collection candidateCollection)
setCandidates in interface Querypublic void setCandidates(Extent candidateExtent)
setCandidates in interface Querypublic void setFilter(String filter)
setFilter in interface Querypublic void declareImports(String imports)
declareImports in interface Querypublic void declareVariables(String variables)
declareVariables in interface Querypublic void declareParameters(String parameters)
declareParameters in interface Querypublic void setOrdering(String ordering)
setOrdering in interface Querypublic void setIgnoreCache(boolean flag)
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 p1)
execute in interface Query
public Object execute(Object p1,
Object p2)
execute in interface Query
public Object execute(Object p1,
Object p2,
Object p3)
execute in interface Querypublic Object executeWithArray(Object[] params)
executeWithArray in interface Querypublic Object executeWithMap(Map params)
executeWithMap in interface Querypublic void closeAll()
closeAll in interface Querypublic void close(Object queryResult)
close in interface Querypublic void registerListener(FilterListener listener)
protected abstract ResultList executeQuery(ClassMetaData type,
boolean subclasses,
com.solarmetric.kodo.query.ExpressionFactory factory,
com.solarmetric.kodo.query.Expression exp,
Map params)
type - the base type the query should matchsubclasses - true if subclasses should be included in the
resultsfactory - the expression factory used to compile the
expressionexp - the compiled expression for the parsed queryparams - map of parameter names to valuesprotected abstract com.solarmetric.kodo.query.ExpressionFactory getExpressionFactory(ClassMetaData type)
ExpressionFactory to use to create an expression to
be executed against an extent. Each factory will be used to compile
one filter only.protected abstract FilterListener getStandardFilterListener(String tag)
Configuration.protected abstract void close(List result)
public boolean getSortDirection(int orderingIndex)
getSortDirection in interface com.solarmetric.kodo.query.Resolverpublic boolean isParameter(String name)
isParameter in interface com.solarmetric.kodo.query.Resolverpublic boolean isVariable(String name)
isVariable in interface com.solarmetric.kodo.query.Resolverpublic Class getParameterClass(String name)
getParameterClass in interface com.solarmetric.kodo.query.Resolverpublic Class getVariableClass(String name)
getVariableClass in interface com.solarmetric.kodo.query.Resolverpublic Class classForName(String name)
classForName in interface com.solarmetric.kodo.query.Resolverpublic FilterListener getFilterListener(String tag)
getFilterListener in interface com.solarmetric.kodo.query.Resolverpublic Extent getCandidateExtent()
getCandidateExtent in interface com.solarmetric.kodo.query.KodoQuerypublic Collection getCandidateCollection()
getCandidateCollection in interface com.solarmetric.kodo.query.KodoQueryprotected void lock()
Multithreaded
flat is set in the persistence manager. Make sure to call
unlock() in a finally clause of the same method.protected void unlock()
public String toString()
toString in class Objectpublic Class getCandidateClass()
getCandidateClass in interface com.solarmetric.kodo.query.KodoQuerypublic String[][] getParameterDeclarations()
getParameterDeclarations in interface com.solarmetric.kodo.query.KodoQuerypublic Set getAccessPathClasses()
getAccessPathClasses 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 enabled)
setQueryCacheEnabled in interface com.solarmetric.kodo.query.KodoQuerypublic boolean getQueryCacheEnabled()
getQueryCacheEnabled in interface com.solarmetric.kodo.query.KodoQuerypublic void setFlushBeforeQueries(int flush)
setFlushBeforeQueries in interface com.solarmetric.kodo.query.KodoQuerypublic int getFlushBeforeQueries()
getFlushBeforeQueries in interface com.solarmetric.kodo.query.KodoQuerypublic Comparator getOrderingComparator()
QueryImpl.QueryResultComparator that is able to order individual
items in the list according to the
setOrdering(java.lang.String) specification. This will
be used when results ordering need to be evaluated in-memory.QueryImpl.QueryResultComparator to order query results, or null if
setOrdering(java.lang.String) has not been called for this Query.
|
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 | ||||||||