public class JDBCStoreQuery extends ExpressionStoreQuery
ExpressionStoreQuery.AbstractExpressionExecutor, ExpressionStoreQuery.DataStoreExecutor, ExpressionStoreQuery.InMemoryExecutor
AbstractStoreQuery.AbstractExecutor
StoreQuery.Executor, StoreQuery.Range
_parsed, _parser
ctx
EMPTY_BOOLEANS, EMPTY_CLASSES, EMPTY_METAS, EMPTY_OBJECTS, EMPTY_ORDERED_PARAMS, EMPTY_PARAMS, EMPTY_STRINGS
OP_DELETE, OP_SELECT, OP_UPDATE
Constructor and Description |
---|
JDBCStoreQuery(JDBCStore store,
ExpressionParser parser)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
evaluate(Object value,
Object ob,
Object[] params,
OpenJPAStateManager sm) |
protected Number |
executeDelete(StoreQuery.Executor ex,
ClassMetaData base,
ClassMetaData[] metas,
boolean subclasses,
ExpressionFactory[] facts,
QueryExpressions[] exps,
Object[] params)
Execute the given expression against the given candidate extent
and delete the instances.
|
protected ResultObjectProvider |
executeQuery(StoreQuery.Executor ex,
ClassMetaData base,
ClassMetaData[] metas,
boolean subclasses,
ExpressionFactory[] facts,
QueryExpressions[] exps,
Object[] params,
StoreQuery.Range range)
Execute the given expression against the given candidate extent.
|
protected Number |
executeUpdate(ClassMetaData base,
ClassMetaData[] metas,
boolean subclasses,
ExpressionFactory[] facts,
QueryExpressions[] parsed,
Object[] params) |
protected int |
executeUpdate(Connection conn,
PreparedStatement stmnt,
SQLBuffer sqlBuf,
boolean isUpdate)
This method is to provide override for non-JDBC or JDBC-like
implementation of executing update.
|
protected Number |
executeUpdate(StoreQuery.Executor ex,
ClassMetaData base,
ClassMetaData[] metas,
boolean subclasses,
ExpressionFactory[] facts,
QueryExpressions[] exps,
Object[] params)
Execute the given expression against the given candidate extent
and updates the instances.
|
protected String[] |
getDataStoreActions(ClassMetaData base,
ClassMetaData[] metas,
boolean subclasses,
ExpressionFactory[] facts,
QueryExpressions[] exps,
Object[] params,
StoreQuery.Range range)
Return the commands that will be sent to the datastore in order
to execute the query, typically in the database's native language.
|
protected ExpressionFactory |
getExpressionFactory(ClassMetaData meta)
Return an
ExpressionFactory to use to create an expression to
be executed against an extent. |
FilterListener |
getFilterListener(String tag)
Return the standard filter listener for the given tag, or null.
|
protected ClassMetaData[] |
getIndependentExpressionCandidates(ClassMetaData meta,
boolean subclasses)
Return the assignable types for the given metadata whose expression
trees must be compiled independently.
|
JDBCStore |
getStore()
Return the store.
|
static Context[] |
getThreadLocalContext() |
static Context |
getThreadLocalContext(Context orig) |
static Context |
getThreadLocalContext(Context lctx,
Context cloneFrom) |
static Select |
getThreadLocalSelect(Select select) |
Object |
newCompilationKey()
Create a new key for caching compiled query information.
|
protected PreparedStatement |
prepareStatement(Connection conn,
SQLBuffer sql)
This method is to provide override for non-JDBC or JDBC-like
implementation of preparing statement.
|
boolean |
supportsDataStoreExecution()
True if this query supports datastore execution, false if it
can only run in memory.
|
getCompilation, getResolver, invalidateCompilation, newCompilation, newDataStoreExecutor, newInMemoryExecutor, populateFromCompilation, setQuery, supportsInMemoryExecution
getAggregateListener, getContext, requiresCandidateType, requiresParameterDeclarations, setContext, supportsAbstractExecutors, supportsParameterDeclarations
public JDBCStoreQuery(JDBCStore store, ExpressionParser parser)
public JDBCStore getStore()
public FilterListener getFilterListener(String tag)
StoreQuery
getFilterListener
in interface StoreQuery
getFilterListener
in class ExpressionStoreQuery
public Object newCompilationKey()
StoreQuery
newCompilationKey
in interface StoreQuery
newCompilationKey
in class AbstractStoreQuery
public boolean supportsDataStoreExecution()
StoreQuery
supportsDataStoreExecution
in interface StoreQuery
supportsDataStoreExecution
in class AbstractStoreQuery
protected ClassMetaData[] getIndependentExpressionCandidates(ClassMetaData meta, boolean subclasses)
ExpressionStoreQuery
getIndependentExpressionCandidates
in class ExpressionStoreQuery
protected ExpressionFactory getExpressionFactory(ClassMetaData meta)
ExpressionStoreQuery
ExpressionFactory
to use to create an expression to
be executed against an extent. Each factory will be used to compile
one filter only. The factory must be cachable.getExpressionFactory
in class ExpressionStoreQuery
protected ResultObjectProvider executeQuery(StoreQuery.Executor ex, ClassMetaData base, ClassMetaData[] metas, boolean subclasses, ExpressionFactory[] facts, QueryExpressions[] exps, Object[] params, StoreQuery.Range range)
ExpressionStoreQuery
executeQuery
in class ExpressionStoreQuery
ex
- current executorbase
- the base type the query should matchmetas
- the independent candidate typessubclasses
- true if subclasses should be included in the resultsfacts
- the expression factory used to build the query for
each base typeexps
- the parsed query valuesparams
- parameter values, or empty arrayrange
- result rangeprotected Number executeDelete(StoreQuery.Executor ex, ClassMetaData base, ClassMetaData[] metas, boolean subclasses, ExpressionFactory[] facts, QueryExpressions[] exps, Object[] params)
ExpressionStoreQuery
executeDelete
in class ExpressionStoreQuery
ex
- current executorbase
- the base type the query should matchmetas
- the independent candidate typessubclasses
- true if subclasses should be included in the resultsfacts
- the expression factory used to build the query for
each base typeexps
- the parsed query valuesparams
- parameter values, or empty arrayprotected Number executeUpdate(StoreQuery.Executor ex, ClassMetaData base, ClassMetaData[] metas, boolean subclasses, ExpressionFactory[] facts, QueryExpressions[] exps, Object[] params)
ExpressionStoreQuery
executeUpdate
in class ExpressionStoreQuery
ex
- current executorbase
- the base type the query should matchmetas
- the independent candidate typessubclasses
- true if subclasses should be included in the resultsfacts
- the expression factory used to build the query for
each base typeexps
- the parsed query valuesparams
- parameter values, or empty arrayprotected Number executeUpdate(ClassMetaData base, ClassMetaData[] metas, boolean subclasses, ExpressionFactory[] facts, QueryExpressions[] parsed, Object[] params)
protected String[] getDataStoreActions(ClassMetaData base, ClassMetaData[] metas, boolean subclasses, ExpressionFactory[] facts, QueryExpressions[] exps, Object[] params, StoreQuery.Range range)
ExpressionStoreQuery
getDataStoreActions
in class ExpressionStoreQuery
base
- the base type the query should matchmetas
- the independent candidate typessubclasses
- true if subclasses should be included in the resultsfacts
- the expression factory used to build the query for
each base typeexps
- the parsed query valuesparams
- parameter values, or empty arrayrange
- result rangeprotected int executeUpdate(Connection conn, PreparedStatement stmnt, SQLBuffer sqlBuf, boolean isUpdate) throws SQLException
SQLException
protected PreparedStatement prepareStatement(Connection conn, SQLBuffer sql) throws SQLException
SQLException
public Object evaluate(Object value, Object ob, Object[] params, OpenJPAStateManager sm)
evaluate
in interface StoreQuery
evaluate
in class AbstractStoreQuery
public static Context[] getThreadLocalContext()
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.