|
||||||||||
| 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.AbstractSQLQuery
public abstract class AbstractSQLQuery
Base definition of a query using SQL. Based around the JDO definition of an SQL query where you typically set the SQL query filter and have parameters set-able but not much else.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.datanucleus.store.query.Query |
|---|
Query.SubqueryDefinition |
| Field Summary | |
|---|---|
protected java.lang.String |
compiledSQL
The actual SQL issued at execution time. |
protected java.lang.String |
inputSQL
The statement that the user specified to the Query. |
protected QueryResultMetaData |
resultMetaData
MetaData defining the results of the query. |
| Fields inherited from class org.datanucleus.store.query.Query |
|---|
BULK_DELETE, BULK_UPDATE, candidateClass, candidateClassName, clr, compilation, ec, explicitParameters, explicitVariables, extensions, filter, from, fromInclNo, fromInclParam, grouping, having, ignoreCache, implicitParameters, imports, LOCALISER, ordering, OTHER, parameterNames, parsedImports, queryResults, range, result, resultClass, resultClassName, resultDistinct, SELECT, subclasses, subqueries, tasks, toExclNo, toExclParam, type, unique, unmodifiable, update |
| Constructor Summary | |
|---|---|
AbstractSQLQuery(ExecutionContext ec,
AbstractSQLQuery query)
Constructs a new query instance from the existing query. |
|
AbstractSQLQuery(ExecutionContext ec,
java.lang.String sqlText)
Constructs a new query instance having the same criteria as the given query. |
|
| Method Summary | |
|---|---|
void |
declareExplicitParameters(java.lang.String parameters)
Declare the explicit parameters to be used in the query. |
void |
declareExplicitVariables(java.lang.String variables)
Declare the unbound variables to be used in the query. |
void |
declareImports(java.lang.String imports)
Set the import statements to be used to identify the fully qualified name of variables or parameters. |
protected void |
discardCompiled()
Utility to discard any compiled query. |
java.lang.Object |
executeWithArray(java.lang.Object[] parameters)
Execute the query and return the filtered List. |
java.lang.Object |
executeWithMap(java.util.Map executeParameters)
Execute the query using the input Map of parameters. |
java.lang.String |
getInputSQL()
Accessor for the user-input SQL query. |
java.lang.String |
getLanguage()
Accessor for the query language. |
protected long |
performDeletePersistentAll(java.util.Map parameters)
Execute the query to delete persistent objects. |
protected java.util.Map |
prepareForExecution(java.util.Map executeParameters)
Method to process the input parameters preparing the statement and parameters for execution. |
void |
setCandidates(java.util.Collection pcs)
Set the candidate Collection to query. |
void |
setCandidates(Extent pcs)
Set the candidate Extent to query. |
void |
setFilter(java.lang.String filter)
Set the filter for the query. |
void |
setGrouping(java.lang.String grouping)
Set the grouping specification for the result Collection. |
void |
setOrdering(java.lang.String ordering)
Set the ordering specification for the result Collection. |
void |
setRange(int fromIncl,
int toExcl)
Set the range of the results. |
void |
setResult(java.lang.String result)
Set the result for the results. |
void |
setResultClass(java.lang.Class result_cls)
Set the result class for the results. |
void |
setResultMetaData(QueryResultMetaData qrmd)
Method to set the MetaData defining the result. |
void |
setSubclasses(boolean subclasses)
Method to set whether to use subclasses. |
protected boolean |
shouldReturnSingleRow()
Convenience method to return whether the query should return a single row. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final transient java.lang.String inputSQL
protected transient java.lang.String compiledSQL
protected QueryResultMetaData resultMetaData
| Constructor Detail |
|---|
public AbstractSQLQuery(ExecutionContext ec,
AbstractSQLQuery query)
ec - ExecutionContextquery - Existing query
public AbstractSQLQuery(ExecutionContext ec,
java.lang.String sqlText)
ec - The ObjectManagersqlText - The SQL query string| Method Detail |
|---|
public java.lang.String getLanguage()
Query
getLanguage in class Queryprotected void discardCompiled()
discardCompiled in class QueryQuery.discardCompiled()public java.lang.String getInputSQL()
public void setCandidates(Extent pcs)
setCandidates in class Querypcs - the Candidate Extent.
NucleusUserException - Always thrown since method not applicablepublic void setCandidates(java.util.Collection pcs)
setCandidates in class Querypcs - the Candidate collection.
NucleusUserException - Always thrown since method not applicablepublic void setResult(java.lang.String result)
setResult in class Queryresult - The result parameter consists of the optional keyword
distinct followed by a commaseparated list of named result expressions or
a result class specification.
NucleusUserException - Always thrown.public void setResultMetaData(QueryResultMetaData qrmd)
setResultMetaData in class Queryqrmd - Query Result MetaDatapublic void setResultClass(java.lang.Class result_cls)
setResultClass in class Queryresult_cls - The result class
public void setRange(int fromIncl,
int toExcl)
fromIncl - From element no (inclusive) to returntoExcl - To element no (exclusive) to return
NucleusUserException - Always thrown.public void setSubclasses(boolean subclasses)
setSubclasses in class Querysubclasses - Whether to use subclasses
NucleusUserException - Always thrown.public void setFilter(java.lang.String filter)
setFilter in class Queryfilter - the query filter.
NucleusUserException - Always thrown since method not applicablepublic void declareExplicitVariables(java.lang.String variables)
declareExplicitVariables in class Queryvariables - the variables separated by semicolons.
NucleusUserException - Always thrown since method not applicablepublic void declareExplicitParameters(java.lang.String parameters)
declareExplicitParameters in class Queryparameters - the parameters separated by semicolons.
NucleusUserException - Always thrown.public void declareImports(java.lang.String imports)
declareImports in class Queryimports - import statements separated by semicolons.
NucleusUserException - Always thrown.public void setGrouping(java.lang.String grouping)
setGrouping in class Querygrouping - the grouping specification.
NucleusUserException - Always thrown.public void setOrdering(java.lang.String ordering)
setOrdering in class Queryordering - the ordering specification.
NucleusUserException - Always thrown.protected long performDeletePersistentAll(java.util.Map parameters)
performDeletePersistentAll in class Queryparameters - the Map containing all of the parameters.
public java.lang.Object executeWithArray(java.lang.Object[] parameters)
executeWithArray in class Queryparameters - the Object array with all of the parameters.
Query.executeQuery(Map parameters)public java.lang.Object executeWithMap(java.util.Map executeParameters)
executeWithMap in class QueryexecuteParameters - the Map of the parameters passed in to execute().
Query.executeQuery(Map parameters)protected java.util.Map prepareForExecution(java.util.Map executeParameters)
executeParameters - The input parameters map
protected boolean shouldReturnSingleRow()
shouldReturnSingleRow in class Query
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||