Package org.apache.openjpa.kernel
Interface StoreQuery
-
- All Superinterfaces:
QueryOperations
,java.io.Serializable
- All Known Implementing Classes:
AbstractStoreQuery
,ExpressionStoreQuery
,JDBCStoreQuery
,MethodStoreQuery
,PreparedSQLStoreQuery
,QueryCacheStoreQuery
,SQLStoreQuery
,StoredProcedureQuery
public interface StoreQuery extends QueryOperations, java.io.Serializable
Component that executes queries against the datastore. For expression-based queries, consider subclassingExpressionStoreManagerQuery
.- Since:
- 0.4.0
- Author:
- Abe White
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
StoreQuery.Executor
An executor provides a uniform interface to the mechanism for executing either an in-memory or datastore query.static class
StoreQuery.Range
A query result range.
-
Field Summary
Fields Modifier and Type Field Description static boolean[]
EMPTY_BOOLEANS
static java.lang.Class<?>[]
EMPTY_CLASSES
static ClassMetaData[]
EMPTY_METAS
static java.lang.Object[]
EMPTY_OBJECTS
static OrderedMap<java.lang.Object,java.lang.Class<?>>
EMPTY_ORDERED_PARAMS
static LinkedMap
EMPTY_PARAMS
static java.lang.String[]
EMPTY_STRINGS
-
Fields inherited from interface org.apache.openjpa.kernel.QueryOperations
OP_DELETE, OP_SELECT, OP_UPDATE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
evaluate(java.lang.Object value, java.lang.Object ob, java.lang.Object[] params, OpenJPAStateManager sm)
AggregateListener
getAggregateListener(java.lang.String tag)
Return the standard filter listener for the given tag, or null.java.lang.Object
getCompilation()
Get the current compilation for this query.QueryContext
getContext()
Return the query context that has been set.FilterListener
getFilterListener(java.lang.String tag)
Return the standard filter listener for the given tag, or null.void
invalidateCompilation()
Invalidate any internal compilation state.java.lang.Object
newCompilation()
Create a new compilation for this query.java.lang.Object
newCompilationKey()
Create a new key for caching compiled query information.StoreQuery.Executor
newDataStoreExecutor(ClassMetaData meta, boolean subs)
Return an executor for datastore execution of this query.StoreQuery.Executor
newInMemoryExecutor(ClassMetaData meta, boolean subs)
Return an executor for in-memory execution of this query.void
populateFromCompilation(java.lang.Object comp)
Populate internal data from compilation.boolean
requiresCandidateType()
Whether this query requires a candidate class.boolean
requiresParameterDeclarations()
Whether this query requires parameters to be declared.void
setContext(QueryContext ctx)
Set the current query context.boolean
setQuery(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.boolean
supportsAbstractExecutors()
Return true if this query supports execution against abstract or interface types.boolean
supportsDataStoreExecution()
True if this query supports datastore execution, false if it can only run in memory.boolean
supportsInMemoryExecution()
True if this query supports in-memory execution, false if it can only run against the datastore.boolean
supportsParameterDeclarations()
Whether this query supports declared parameters.
-
-
-
Field Detail
-
EMPTY_PARAMS
static final LinkedMap EMPTY_PARAMS
-
EMPTY_ORDERED_PARAMS
static final OrderedMap<java.lang.Object,java.lang.Class<?>> EMPTY_ORDERED_PARAMS
-
EMPTY_METAS
static final ClassMetaData[] EMPTY_METAS
-
EMPTY_STRINGS
static final java.lang.String[] EMPTY_STRINGS
-
EMPTY_OBJECTS
static final java.lang.Object[] EMPTY_OBJECTS
-
EMPTY_CLASSES
static final java.lang.Class<?>[] EMPTY_CLASSES
-
EMPTY_BOOLEANS
static final boolean[] EMPTY_BOOLEANS
-
-
Method Detail
-
getContext
QueryContext getContext()
Return the query context that has been set.
-
setContext
void setContext(QueryContext ctx)
Set the current query context. This will be called before use.
-
setQuery
boolean setQuery(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. Return true if the object is recognized by the store, false otherwise.
-
getFilterListener
FilterListener getFilterListener(java.lang.String tag)
Return the standard filter listener for the given tag, or null.
-
getAggregateListener
AggregateListener getAggregateListener(java.lang.String tag)
Return the standard filter listener for the given tag, or null.
-
newCompilationKey
java.lang.Object newCompilationKey()
Create a new key for caching compiled query information. May be null.
-
newCompilation
java.lang.Object newCompilation()
Create a new compilation for this query. May be null.
-
getCompilation
java.lang.Object getCompilation()
Get the current compilation for this query. If it is null, do not create.
-
populateFromCompilation
void populateFromCompilation(java.lang.Object comp)
Populate internal data from compilation.
-
invalidateCompilation
void invalidateCompilation()
Invalidate any internal compilation state.
-
supportsDataStoreExecution
boolean supportsDataStoreExecution()
True if this query supports datastore execution, false if it can only run in memory.
-
supportsInMemoryExecution
boolean supportsInMemoryExecution()
True if this query supports in-memory execution, false if it can only run against the datastore.
-
newInMemoryExecutor
StoreQuery.Executor newInMemoryExecutor(ClassMetaData meta, boolean subs)
Return an executor for in-memory execution of this query. Executors must be cachable and thread safe. If this class returns true fromsupportsAbstractExecutors()
, 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.- Parameters:
subs
- whether to include dependent mapped subclasses in the results; independent subclasses should never be included
-
newDataStoreExecutor
StoreQuery.Executor newDataStoreExecutor(ClassMetaData meta, boolean subs)
Return an executor for datastore execution of this query. Executors must be cachable and thread safe. If this class returns true fromsupportsAbstractExecutors()
, 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.- Parameters:
subs
- whether to include dependent mapped subclasses in the results; independent subclasses should never be included
-
supportsAbstractExecutors
boolean supportsAbstractExecutors()
Return 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.
-
requiresCandidateType
boolean requiresCandidateType()
Whether this query requires a candidate class.
-
requiresParameterDeclarations
boolean requiresParameterDeclarations()
Whether this query requires parameters to be declared.
-
supportsParameterDeclarations
boolean supportsParameterDeclarations()
Whether this query supports declared parameters.
-
evaluate
java.lang.Object evaluate(java.lang.Object value, java.lang.Object ob, java.lang.Object[] params, OpenJPAStateManager sm)
-
-