Package org.apache.openjpa.jdbc.kernel
Class SQLStoreQuery
- java.lang.Object
-
- org.apache.openjpa.kernel.AbstractStoreQuery
-
- org.apache.openjpa.jdbc.kernel.SQLStoreQuery
-
- All Implemented Interfaces:
java.io.Serializable,QueryOperations,StoreQuery
- Direct Known Subclasses:
PreparedSQLStoreQuery
public class SQLStoreQuery extends AbstractStoreQuery
A SQL query.- Author:
- Abe White
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSQLStoreQuery.SQLExecutorExecutes the filter as a SQL query.-
Nested classes/interfaces inherited from class org.apache.openjpa.kernel.AbstractStoreQuery
AbstractStoreQuery.AbstractExecutor
-
Nested classes/interfaces inherited from interface org.apache.openjpa.kernel.StoreQuery
StoreQuery.Executor, StoreQuery.Range
-
-
Field Summary
-
Fields inherited from class org.apache.openjpa.kernel.AbstractStoreQuery
ctx
-
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 SQLStoreQuery(JDBCStore store)Construct a query managed by the given context.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JDBCStoregetStore()StoreQuery.ExecutornewDataStoreExecutor(ClassMetaData meta, boolean subclasses)Return an executor for datastore execution of this query.booleanrequiresCandidateType()Whether this query requires a candidate class.booleanrequiresParameterDeclarations()Whether this query requires parameters to be declared.static java.lang.StringsubstituteParams(java.lang.String sql, java.util.List<java.lang.Integer> paramOrder)Utility method to substitute '?booleansupportsDataStoreExecution()True if this query supports datastore execution, false if it can only run in memory.booleansupportsParameterDeclarations()Whether this query supports declared parameters.-
Methods inherited from class org.apache.openjpa.kernel.AbstractStoreQuery
evaluate, getAggregateListener, getCompilation, getContext, getFilterListener, invalidateCompilation, newCompilation, newCompilationKey, newInMemoryExecutor, populateFromCompilation, setContext, setQuery, supportsAbstractExecutors, supportsInMemoryExecution
-
-
-
-
Constructor Detail
-
SQLStoreQuery
public SQLStoreQuery(JDBCStore store)
Construct a query managed by the given context.
-
-
Method Detail
-
getStore
public JDBCStore getStore()
-
supportsParameterDeclarations
public boolean supportsParameterDeclarations()
Description copied from interface:StoreQueryWhether this query supports declared parameters.- Specified by:
supportsParameterDeclarationsin interfaceStoreQuery- Overrides:
supportsParameterDeclarationsin classAbstractStoreQuery
-
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- Overrides:
supportsDataStoreExecutionin classAbstractStoreQuery
-
newDataStoreExecutor
public StoreQuery.Executor newDataStoreExecutor(ClassMetaData meta, boolean subclasses)
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 interfaceStoreQuery- Overrides:
newDataStoreExecutorin classAbstractStoreQuerysubclasses- whether to include dependent mapped subclasses in the results; independent subclasses should never be included
-
requiresCandidateType
public boolean requiresCandidateType()
Description copied from interface:StoreQueryWhether this query requires a candidate class.- Specified by:
requiresCandidateTypein interfaceStoreQuery- Overrides:
requiresCandidateTypein classAbstractStoreQuery
-
requiresParameterDeclarations
public boolean requiresParameterDeclarations()
Description copied from interface:StoreQueryWhether this query requires parameters to be declared.- Specified by:
requiresParameterDeclarationsin interfaceStoreQuery- Overrides:
requiresParameterDeclarationsin classAbstractStoreQuery
-
substituteParams
public static java.lang.String substituteParams(java.lang.String sql, java.util.List<java.lang.Integer> paramOrder) throws java.io.IOExceptionUtility method to substitute '?num' for parameters in the given SQL statement, and fill-in the order of the parameter tokens- Throws:
java.io.IOException
-
-