|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.query.Query
org.datanucleus.store.query.AbstractJavaQuery
org.datanucleus.store.query.AbstractJPQLQuery
org.datanucleus.store.rdbms.query2.JPQLQuery2
public class JPQLQuery2
RDBMS representation of a JPQL query for use by DataNucleus. The query can be specified via method calls, or via a single-string form. This implementation uses the generic query compilation in "org.datanucleus.query" and will ultimately replace the version in "JPQLQuery". There are the following main ways of running a query here
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.datanucleus.store.query.Query |
|---|
org.datanucleus.store.query.Query.SubqueryDefinition |
| Field Summary |
|---|
| Fields inherited from class org.datanucleus.store.query.AbstractJavaQuery |
|---|
candidateCollection, candidateExtent, singleString |
| Fields inherited from class org.datanucleus.store.query.Query |
|---|
BULK_DELETE, BULK_UPDATE, candidateClass, candidateClassName, compilation, explicitParameters, explicitVariables, extensions, filter, from, fromInclNo, grouping, having, ignoreCache, implicitParameters, imports, LOCALISER, om, ordering, parameterNames, parsedImports, queryResults, range, result, resultClass, resultClassName, resultDistinct, SELECT, subclasses, subqueries, tasks, toExclNo, type, unique, unmodifiable, update |
| Constructor Summary | |
|---|---|
JPQLQuery2(org.datanucleus.ObjectManager om)
Constructs a new query instance that uses the given object manager. |
|
JPQLQuery2(org.datanucleus.ObjectManager om,
JPQLQuery2 q)
Constructs a new query instance having the same criteria as the given query. |
|
JPQLQuery2(org.datanucleus.ObjectManager om,
java.lang.String query)
Constructor for a JPQL query where the query is specified using the "Single-String" format. |
|
| Method Summary | |
|---|---|
void |
applyParametersToStatement(java.util.Map parameterValuesByName,
java.sql.PreparedStatement ps)
Method to populate all parameters in the supplied PreparedStatement. |
protected boolean |
applyRangeChecks()
Method to return if the query results should have the range checked and unnecessary rows discarded. |
protected void |
assertSupportsCancel()
Method that will throw an UnsupportedOperationException if the query implementation doesn't
support cancelling queries. |
protected void |
compileInternal(boolean forExecute,
java.util.Map parameterValues)
Method to compile the JPQL query. |
protected void |
discardCompiled()
Utility to remove any previous compilation of this Query. |
java.lang.String |
getSQL()
Convenience accessor for the SQL to invoke in the datastore for this query. |
java.util.Set<java.lang.String> |
getSupportedExtensions()
Method to return the names of the extensions supported by this query. |
protected boolean |
isCompiled()
Method to return if the query is compiled. |
protected java.lang.Object |
performExecute(java.util.Map parameters)
|
protected java.lang.Object |
performExecuteInternal(java.lang.Object... args)
Method executing the query in the destination environment. |
void |
setImplicitParameter(int position,
java.lang.Object value)
|
void |
setImplicitParameter(java.lang.String name,
java.lang.Object value)
|
| Methods inherited from class org.datanucleus.store.query.AbstractJPQLQuery |
|---|
getSingleStringQuery, resolveClassDeclaration, setResult |
| Methods inherited from class org.datanucleus.store.query.AbstractJavaQuery |
|---|
evaluateInMemory, getCandidateCollection, getCandidateExtent, performDeletePersistentAll, setCandidates, setCandidates, toString |
| Methods inherited from class org.datanucleus.store.query.Query |
|---|
addExtension, addSubquery, applyImplicitParameterValueToCompilation, assertIsModifiable, cancel, cancel, checkParameterTypesAgainstCompilation, close, closeAll, compile, declareExplicitParameters, declareExplicitVariables, declareImports, deletePersistentAll, deletePersistentAll, deletePersistentAll, equals, execute, executeQuery, executeWithArray, executeWithMap, getBooleanExtensionProperty, getCandidateClass, getCandidateClassName, getCompilation, getExplicitParameters, getExplicitVariables, getExtension, getExtensions, getFetchPlan, getFilter, getFrom, getGrouping, getHaving, getIgnoreCache, getImplicitParameters, getImports, getInputParameters, getObjectManager, getOrdering, getParameterMapForValues, getParsedImports, getPerformExecuteTask, getRange, getRangeFromIncl, getRangeToExcl, getResult, getResultClass, getResultClassName, getResultDistinct, getSerializeRead, getStoreManager, getSubqueryForVariable, getTimeoutMillis, getType, getUpdate, hashCode, hasSubqueryForVariable, isSubclasses, isUnique, isUnmodifiable, performExecuteTask, prepareDatastore, setCandidateClassName, setClass, setExtensions, setFetchPlan, setFilter, setFrom, setGrouping, setHaving, setIgnoreCache, setOrdering, setRange, setRange, setResultClass, setResultClassName, setResultDistinct, setResultMetaData, setSerializeRead, setSubclasses, setTimeoutMillis, setType, setUnique, setUnmodifiable, setUpdate, shouldReturnSingleRow, useFetchPlan |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JPQLQuery2(org.datanucleus.ObjectManager om)
om - The ObjectManager
public JPQLQuery2(org.datanucleus.ObjectManager om,
JPQLQuery2 q)
om - The ObjectManagerq - The query from which to copy criteria.
public JPQLQuery2(org.datanucleus.ObjectManager om,
java.lang.String query)
om - The ObjectManagerquery - The single-string query form| Method Detail |
|---|
public void setImplicitParameter(int position,
java.lang.Object value)
setImplicitParameter in class org.datanucleus.store.query.Query
public void setImplicitParameter(java.lang.String name,
java.lang.Object value)
setImplicitParameter in class org.datanucleus.store.query.Queryprotected void discardCompiled()
discardCompiled in class org.datanucleus.store.query.AbstractJavaQueryprotected boolean isCompiled()
isCompiled in class org.datanucleus.store.query.Query
protected void compileInternal(boolean forExecute,
java.util.Map parameterValues)
compileInternal in class org.datanucleus.store.query.AbstractJPQLQueryforExecute - Whether compiling for execution NOT USED HERE. TODO Remove this when possibleparameterValues - Map of param values keyed by param name (if available at compile time)public java.lang.String getSQL()
protected java.lang.Object performExecute(java.util.Map parameters)
performExecute in class org.datanucleus.store.query.Queryprotected void assertSupportsCancel()
UnsupportedOperationException if the query implementation doesn't
support cancelling queries.
assertSupportsCancel in class org.datanucleus.store.query.Queryprotected java.lang.Object performExecuteInternal(java.lang.Object... args)
performExecuteInternal in class org.datanucleus.store.query.Queryargs - Arguments to the execution (SQLController, ManagedConnection, PreparedStatement)
public void applyParametersToStatement(java.util.Map parameterValuesByName,
java.sql.PreparedStatement ps)
throws java.sql.SQLException
parameterValuesByName - Map of parameter values keyed by the name.ps - PreparedStatement
java.sql.SQLException - Thrown if an error occurs setting the parameterspublic java.util.Set<java.lang.String> getSupportedExtensions()
getSupportedExtensions in class org.datanucleus.store.query.AbstractJavaQueryprotected boolean applyRangeChecks()
applyRangeChecks in class org.datanucleus.store.query.Query
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||