|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.store.query.Query
org.jpox.store.query.AbstractSQLQuery
public abstract class AbstractSQLQuery
Base definition of a query using SQL. Is based around the JDO definition of an SQL query where you typically set the SQL query filter and have parameters settable but not much else.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jpox.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.jpox.store.query.Query |
|---|
BULK_DELETE, BULK_UPDATE, candidateClass, candidateClassName, explicitParameters, explicitVariables, extensions, filter, from, fromInclNo, grouping, having, ignoreCache, implicitParameters, imports, isCompiled, LOCALISER, om, ordering, parameterNames, parsedImports, queryResults, range, result, resultClass, resultClassName, SELECT, subclasses, subqueries, toExclNo, type, unique, unmodifiable, update |
| Constructor Summary | |
|---|---|
AbstractSQLQuery(ObjectManager om,
AbstractSQLQuery query)
Constructs a new query instance from the existing query. |
|
AbstractSQLQuery(ObjectManager om,
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 and return the filtered List. |
java.lang.String |
getInputSQL()
Accessor for the user-input SQL query. |
protected long |
performDeletePersistentAll(java.util.Map parameters)
Execute the query to delete persistent objects. |
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(ObjectManager om,
AbstractSQLQuery query)
om - Object Managerquery - Existing query
public AbstractSQLQuery(ObjectManager om,
java.lang.String sqlText)
om - The ObjectManagersqlText - The SQL query string| Method Detail |
|---|
protected void discardCompiled()
discardCompiled in class QueryQuery.discardCompiled()public java.lang.String getInputSQL()
protected boolean shouldReturnSingleRow()
shouldReturnSingleRow in class Querypublic void setCandidates(Extent pcs)
setCandidates in class Querypcs - the Candidate Extent.
JPOXUserException - Always thrown since method not applicableQuery.setCandidates(javax.jdo.Extent)public void setCandidates(java.util.Collection pcs)
setCandidates in class Querypcs - the Candidate collection.
JPOXUserException - Always thrown since method not applicableQuery.setCandidates(java.util.Collection)public 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.
JPOXUserException - Always thrown.Query.setResult(java.lang.String)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 classQuery.setResultClass(java.lang.Class)
public void setRange(int fromIncl,
int toExcl)
fromIncl - From element no (inclusive) to returntoExcl - To element no (exclusive) to return
JPOXUserException - Always thrown.public void setSubclasses(boolean subclasses)
setSubclasses in class Querysubclasses - Whether to use subclasses
JPOXUserException - Always thrown.public void setFilter(java.lang.String filter)
setFilter in class Queryfilter - the query filter.
JPOXUserException - Always thrown since method not applicableQuery.setFilter(java.lang.String)public void declareExplicitVariables(java.lang.String variables)
declareExplicitVariables in class Queryvariables - the variables separated by semicolons.
JPOXUserException - Always thrown since method not applicablepublic void declareExplicitParameters(java.lang.String parameters)
declareExplicitParameters in class Queryparameters - the parameters separated by semicolons.
JPOXUserException - Always thrown.public void declareImports(java.lang.String imports)
declareImports in class Queryimports - import statements separated by semicolons.
JPOXUserException - Always thrown.Query.declareImports(java.lang.String)public void setGrouping(java.lang.String grouping)
setGrouping in class Querygrouping - the grouping specification.
JPOXUserException - Always thrown.Query.setGrouping(java.lang.String)public void setOrdering(java.lang.String ordering)
setOrdering in class Queryordering - the ordering specification.
JPOXUserException - Always thrown.Query.setOrdering(java.lang.String)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.executeWithArray(Object[])public java.lang.Object executeWithMap(java.util.Map executeParameters)
executeWithMap in class QueryexecuteParameters - the Map of the parameters passed in to execute().
Query.executeWithMap(Map),
Query.executeWithArray(Object[] parameters)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||