public class RDBMSQueryUtils
extends org.datanucleus.query.QueryUtils
Constructor and Description |
---|
RDBMSQueryUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getClassNameFromDiscriminatorResultSetRow(JavaTypeMapping discrimMapping,
org.datanucleus.metadata.DiscriminatorMetaData dismd,
ResultSet rs,
org.datanucleus.ExecutionContext ec)
Convenience method that takes a result set that contains a discriminator column and returns
the class name that it represents.
|
static PreparedStatement |
getPreparedStatementForQuery(org.datanucleus.store.connection.ManagedConnection conn,
String queryStmt,
org.datanucleus.store.query.Query query)
Method to create a PreparedStatement for use with the query.
|
static ResultObjectFactory |
getResultObjectFactoryForNoCandidateClass(RDBMSStoreManager storeMgr,
ResultSet rs,
Class resultClass)
Utility to take a ResultSet and return a ResultObjectFactory for extracting the results,
assuming that no candidate class is supplied.
|
static String |
getResultSetConcurrencyForQuery(org.datanucleus.store.query.Query query)
Accessor for the result set concurrency for the specified query.
|
static String |
getResultSetTypeForQuery(org.datanucleus.store.query.Query query)
Accessor for the result set type for the specified query.
|
static SQLStatement |
getStatementForCandidates(RDBMSStoreManager storeMgr,
SQLStatement parentStmt,
org.datanucleus.metadata.AbstractClassMetaData cmd,
StatementClassMapping clsMapping,
org.datanucleus.ExecutionContext ec,
Class candidateCls,
boolean subclasses,
String result,
String candidateAlias,
String candidateTableGroupName)
Method to return a statement selecting the candidate table(s) required to cover all possible
types for this candidates inheritance strategy.
|
static void |
prepareStatementForExecution(PreparedStatement ps,
org.datanucleus.store.query.Query query,
boolean applyTimeout)
Method to apply any restrictions to the created ResultSet.
|
static boolean |
useUpdateLockForQuery(org.datanucleus.store.query.Query query)
Convenience method to return if the specified query should use an "UPDATE" lock on returned objects.
|
compareExpressionValues, createResultObjectUsingArgumentedConstructor, createResultObjectUsingDefaultConstructorAndSetters, createResultObjectUsingDefaultConstructorAndSetters, expressionHasNotOperator, expressionHasOrOperator, getExpressionsFromString, getKeyForQueryResultsCache, getParameterExpressionForPosition, getPublicPutMethodForResultClass, getPublicSetMethodForFieldOfResultClass, getStringValue, getStringValueForExpression, getValueForParameterExpression, orderCandidates, orderCandidates, orderCandidates, queryParameterTypesAreCompatible, queryReturnsSingleRow, resultClassIsSimple, resultClassIsUserType, resultHasOnlyAggregates
public static String getClassNameFromDiscriminatorResultSetRow(JavaTypeMapping discrimMapping, org.datanucleus.metadata.DiscriminatorMetaData dismd, ResultSet rs, org.datanucleus.ExecutionContext ec)
discrimMapping
- Mapping for the discriminator columndismd
- Metadata for the discriminatorrs
- The result setec
- execution contextpublic static String getResultSetTypeForQuery(org.datanucleus.store.query.Query query)
query
- The querypublic static String getResultSetConcurrencyForQuery(org.datanucleus.store.query.Query query)
query
- The querypublic static boolean useUpdateLockForQuery(org.datanucleus.store.query.Query query)
query
- The querypublic static PreparedStatement getPreparedStatementForQuery(org.datanucleus.store.connection.ManagedConnection conn, String queryStmt, org.datanucleus.store.query.Query query) throws SQLException
conn
- the ConnectionqueryStmt
- The statement text for the queryquery
- The querySQLException
- Thrown if an error occurs creating the statementpublic static void prepareStatementForExecution(PreparedStatement ps, org.datanucleus.store.query.Query query, boolean applyTimeout) throws SQLException
ps
- The PreparedStatementquery
- The queryapplyTimeout
- Whether to apply the query timeout (if any) direct to the PreparedStatementSQLException
- Thrown when an error occurs applying the constraintspublic static SQLStatement getStatementForCandidates(RDBMSStoreManager storeMgr, SQLStatement parentStmt, org.datanucleus.metadata.AbstractClassMetaData cmd, StatementClassMapping clsMapping, org.datanucleus.ExecutionContext ec, Class candidateCls, boolean subclasses, String result, String candidateAlias, String candidateTableGroupName)
storeMgr
- RDBMS StoreManagerparentStmt
- Parent statement (if there is one)cmd
- Metadata for the classclsMapping
- Mapping for the results of the statementec
- ExecutionContextcandidateCls
- Candidate classsubclasses
- Whether to create a statement for subclasses of the candidate tooresult
- The result clausecandidateAlias
- alias for the candidate (if any)candidateTableGroupName
- TableGroup name for the candidate (if any)org.datanucleus.exceptions.NucleusException
- if there are no tables for concrete classes in this query (hence would return null)public static ResultObjectFactory getResultObjectFactoryForNoCandidateClass(RDBMSStoreManager storeMgr, ResultSet rs, Class resultClass)
storeMgr
- RDBMS StoreManagerrs
- The ResultSetresultClass
- Result class if required (or null)Copyright © 2017. All rights reserved.