Package org.apache.openjpa.kernel
Class AbstractStoreQuery
- java.lang.Object
-
- org.apache.openjpa.kernel.AbstractStoreQuery
-
- All Implemented Interfaces:
java.io.Serializable,QueryOperations,StoreQuery
- Direct Known Subclasses:
ExpressionStoreQuery,MethodStoreQuery,SQLStoreQuery,StoredProcedureQuery
public abstract class AbstractStoreQuery extends java.lang.Object implements StoreQuery
AbstractStoreQuerythat implements most methods as no-ops.- Since:
- 0.4.0
- Author:
- Abe White
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractStoreQuery.AbstractExecutorAbstractStoreQuery.Executorthat implements most methods as no-ops.-
Nested classes/interfaces inherited from interface org.apache.openjpa.kernel.StoreQuery
StoreQuery.Executor, StoreQuery.Range
-
-
Field Summary
Fields Modifier and Type Field Description protected QueryContextctx-
Fields inherited from interface org.apache.openjpa.kernel.QueryOperations
OP_DELETE, OP_SELECT, OP_UPDATE
-
Fields inherited from interface org.apache.openjpa.kernel.StoreQuery
EMPTY_BOOLEANS, EMPTY_CLASSES, EMPTY_METAS, EMPTY_OBJECTS, EMPTY_ORDERED_PARAMS, EMPTY_PARAMS, EMPTY_STRINGS
-
-
Constructor Summary
Constructors Constructor Description AbstractStoreQuery()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectevaluate(java.lang.Object value, java.lang.Object ob, java.lang.Object[] params, OpenJPAStateManager sm)AggregateListenergetAggregateListener(java.lang.String tag)Return the standard filter listener for the given tag, or null.java.lang.ObjectgetCompilation()Get the current compilation for this query.QueryContextgetContext()Return the query context that has been set.FilterListenergetFilterListener(java.lang.String tag)Return the standard filter listener for the given tag, or null.voidinvalidateCompilation()Invalidate any internal compilation state.java.lang.ObjectnewCompilation()Create a new compilation for this query.java.lang.ObjectnewCompilationKey()Create a new key for caching compiled query information.StoreQuery.ExecutornewDataStoreExecutor(ClassMetaData meta, boolean subs)Return an executor for datastore execution of this query.StoreQuery.ExecutornewInMemoryExecutor(ClassMetaData meta, boolean subs)Return an executor for in-memory execution of this query.voidpopulateFromCompilation(java.lang.Object comp)Populate internal data from compilation.booleanrequiresCandidateType()Whether this query requires a candidate class.booleanrequiresParameterDeclarations()Whether this query requires parameters to be declared.voidsetContext(QueryContext ctx)Set the current query context.booleansetQuery(java.lang.Object query)This is invoked when the user or a facade creates a new query with an object that the system does not recognize.booleansupportsAbstractExecutors()Return true if this query supports execution against abstract or interface types.booleansupportsDataStoreExecution()True if this query supports datastore execution, false if it can only run in memory.booleansupportsInMemoryExecution()True if this query supports in-memory execution, false if it can only run against the datastore.booleansupportsParameterDeclarations()Whether this query supports declared parameters.
-
-
-
Field Detail
-
ctx
protected QueryContext ctx
-
-
Method Detail
-
getContext
public QueryContext getContext()
Description copied from interface:StoreQueryReturn the query context that has been set.- Specified by:
getContextin interfaceStoreQuery
-
setContext
public void setContext(QueryContext ctx)
Description copied from interface:StoreQuerySet the current query context. This will be called before use.- Specified by:
setContextin interfaceStoreQuery
-
setQuery
public boolean setQuery(java.lang.Object query)
Description copied from interface:StoreQueryThis is invoked when the user or a facade creates a new query with an object that the system does not recognize. Return true if the object is recognized by the store, false otherwise.- Specified by:
setQueryin interfaceStoreQuery
-
getFilterListener
public FilterListener getFilterListener(java.lang.String tag)
Description copied from interface:StoreQueryReturn the standard filter listener for the given tag, or null.- Specified by:
getFilterListenerin interfaceStoreQuery
-
getAggregateListener
public AggregateListener getAggregateListener(java.lang.String tag)
Description copied from interface:StoreQueryReturn the standard filter listener for the given tag, or null.- Specified by:
getAggregateListenerin interfaceStoreQuery
-
newCompilationKey
public java.lang.Object newCompilationKey()
Description copied from interface:StoreQueryCreate a new key for caching compiled query information. May be null.- Specified by:
newCompilationKeyin interfaceStoreQuery
-
newCompilation
public java.lang.Object newCompilation()
Description copied from interface:StoreQueryCreate a new compilation for this query. May be null.- Specified by:
newCompilationin interfaceStoreQuery
-
getCompilation
public java.lang.Object getCompilation()
Description copied from interface:StoreQueryGet the current compilation for this query. If it is null, do not create.- Specified by:
getCompilationin interfaceStoreQuery
-
populateFromCompilation
public void populateFromCompilation(java.lang.Object comp)
Description copied from interface:StoreQueryPopulate internal data from compilation.- Specified by:
populateFromCompilationin interfaceStoreQuery
-
invalidateCompilation
public void invalidateCompilation()
Description copied from interface:StoreQueryInvalidate any internal compilation state.- Specified by:
invalidateCompilationin interfaceStoreQuery
-
supportsDataStoreExecution
public boolean supportsDataStoreExecution()
Description copied from interface:StoreQueryTrue if this query supports datastore execution, false if it can only run in memory.- Specified by:
supportsDataStoreExecutionin interfaceStoreQuery
-
supportsInMemoryExecution
public boolean supportsInMemoryExecution()
Description copied from interface:StoreQueryTrue if this query supports in-memory execution, false if it can only run against the datastore.- Specified by:
supportsInMemoryExecutionin interfaceStoreQuery
-
newInMemoryExecutor
public StoreQuery.Executor newInMemoryExecutor(ClassMetaData meta, boolean subs)
Description copied from interface:StoreQueryReturn an executor for in-memory execution of this query. Executors must be cachable and thread safe. If this class returns true fromStoreQuery.supportsAbstractExecutors(), the given metadata will always be for the candidate class of this query, or possibly null if the candidate class is not itself persistence capable (like an interface or abstract base class). Otherwise, the given type will be a mapped class.- Specified by:
newInMemoryExecutorin interfaceStoreQuerysubs- whether to include dependent mapped subclasses in the results; independent subclasses should never be included
-
newDataStoreExecutor
public StoreQuery.Executor newDataStoreExecutor(ClassMetaData meta, boolean subs)
Description copied from interface:StoreQueryReturn an executor for datastore execution of this query. Executors must be cachable and thread safe. If this class returns true fromStoreQuery.supportsAbstractExecutors(), the given metadata will always be for the candidate class of this query, or possibly null if the candidate class is not itself persistence capable (like an interface or abstract base class). Otherwise, the given type will be a mapped class.- Specified by:
newDataStoreExecutorin interfaceStoreQuerysubs- whether to include dependent mapped subclasses in the results; independent subclasses should never be included
-
supportsAbstractExecutors
public boolean supportsAbstractExecutors()
Description copied from interface:StoreQueryReturn true if this query supports execution against abstract or interface types. Returns false by default, meaning we will only request executors for persistent classes. In this case, we will automatically combine the results of the executors for all implementing classes if we execute a query for an interface for abstract type.- Specified by:
supportsAbstractExecutorsin interfaceStoreQuery
-
requiresCandidateType
public boolean requiresCandidateType()
Description copied from interface:StoreQueryWhether this query requires a candidate class.- Specified by:
requiresCandidateTypein interfaceStoreQuery
-
requiresParameterDeclarations
public boolean requiresParameterDeclarations()
Description copied from interface:StoreQueryWhether this query requires parameters to be declared.- Specified by:
requiresParameterDeclarationsin interfaceStoreQuery
-
supportsParameterDeclarations
public boolean supportsParameterDeclarations()
Description copied from interface:StoreQueryWhether this query supports declared parameters.- Specified by:
supportsParameterDeclarationsin interfaceStoreQuery
-
evaluate
public java.lang.Object evaluate(java.lang.Object value, java.lang.Object ob, java.lang.Object[] params, OpenJPAStateManager sm)- Specified by:
evaluatein interfaceStoreQuery
-
-