|
|||||||||||
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.rdbms.query.BaseSQLQuery
Base definition of a query using SQL.
Query
,
Serialized FormNested Class Summary |
Nested classes inherited from class org.jpox.store.query.Query |
Query.ResultObjectFactory |
Field Summary | |
protected java.util.List |
fieldColumnNames
|
protected int[] |
fieldNumbers
|
protected java.lang.String |
jdbcSqlText
|
protected static Localiser |
LOCALISER_RDBMS
Localiser for messages. |
protected java.lang.String |
sqlText
|
protected StatementExpressionIndex[] |
statementExpressionIndex
|
Fields inherited from class org.jpox.store.query.Query |
candidateClass, candidateClassName, dba, extensions, fetchPlan, filter, fromInclNo, grouping, ignoreCache, imports, isCompiled, isPreCompile, LOCALISER, ordering, parameterNames, parameters, parameterTypesByName, parsedImports, pm, queryResults, range, result, resultClass, resultClassName, subclasses, toExclNo, unique, unmodifiable, variableNames, variables, variableTypesByName |
Fields inherited from interface javax.jdo.Query |
JDOQL, SQL |
Constructor Summary | |
BaseSQLQuery(PersistenceManager pm,
BaseSQLQuery query)
Constructs a new query instance from the existing query. |
|
BaseSQLQuery(PersistenceManager pm,
java.lang.String sql_text)
Constructs a new query instance having the same criteria as the given query. |
Method Summary | |
void |
compile()
Verify the elements of the query and provide a hint to the query to prepare and optimize an execution plan. |
void |
declareVariables(java.lang.String variables)
Declare the unbound variables to be used in the query. |
protected void |
discardCompiled()
Utility to discard any compiled query. |
protected abstract void |
generateQueryStatement()
Convenience method to take the user specified SQL statement, and align it with field names for the candidate class etc. |
protected QueryResult |
getQueryResultForNoCandidateClass(java.sql.ResultSet rs)
Utility to take a ResultSet and return a QueryResult for those results, assuming that no candidate class is supplied. |
protected long |
performDeletePersistentAll(java.util.Map parameters)
Execute the query to delete persistent objects. |
abstract java.util.Collection |
performExecute(java.util.Map parameters)
Execute the query and return the filtered QueryResult. |
void |
setCandidates(java.util.Collection pcs)
Set the candidate Collection to query. |
void |
setCandidates(javax.jdo.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 |
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 static final Localiser LOCALISER_RDBMS
protected final transient java.lang.String sqlText
protected transient java.lang.String jdbcSqlText
protected transient int[] fieldNumbers
protected transient java.util.List fieldColumnNames
protected transient StatementExpressionIndex[] statementExpressionIndex
Constructor Detail |
public BaseSQLQuery(PersistenceManager pm, BaseSQLQuery query)
pm
- Persistence Managerquery
- Existing querypublic BaseSQLQuery(PersistenceManager pm, java.lang.String sql_text)
pm
- The PersistenceManagersql_text
- The SQL query stringMethod Detail |
protected void discardCompiled()
discardCompiled
in class Query
Query.discardCompiled()
protected boolean shouldReturnSingleRow()
shouldReturnSingleRow
in class Query
public void setCandidates(javax.jdo.Extent pcs)
This implementation always throws a JDOUserException since this concept doesn't apply to SQL queries.
setCandidates
in interface javax.jdo.Query
setCandidates
in class Query
pcs
- the Candidate Extent.
javax.jdo.JDOUserException
- Always thrown.Query.setCandidates(javax.jdo.Extent)
public void setCandidates(java.util.Collection pcs)
This implementation always throws a JDOUserException since this concept doesn't apply to SQL queries.
setCandidates
in interface javax.jdo.Query
setCandidates
in class Query
pcs
- the Candidate collection.
javax.jdo.JDOUserException
- Always thrown.Query.setCandidates(java.util.Collection)
public void setResult(java.lang.String result)
This implementation always throws a JDOUserException since this concept doesn't apply to SQL queries.
setResult
in interface javax.jdo.Query
setResult
in class Query
result
- The result parameter consists of the optional keyword
distinct followed by a commaseparated list of named result expressions or
a result class specification.Query.setResult(java.lang.String)
public void setRange(int fromIncl, int toExcl)
fromIncl
- From element no (inclusive) to returntoExcl
- To element no (exclusive) to returnQuery.setRange(long, long)
public void setSubclasses(boolean subclasses)
setSubclasses
in class Query
subclasses
- Whether to use subclassespublic void setFilter(java.lang.String filter)
This implementation always throws a JDOUserException since this concept doesn't apply to SQL queries.
setFilter
in interface javax.jdo.Query
setFilter
in class Query
filter
- the query filter.
javax.jdo.JDOUserException
- Always thrown.Query.setFilter(java.lang.String)
public void declareVariables(java.lang.String variables)
This implementation always throws a JDOUserException since this concept doesn't apply to SQL queries.
declareVariables
in interface javax.jdo.Query
declareVariables
in class Query
variables
- the variables separated by semicolons.
javax.jdo.JDOUserException
- Always thrown.Query.declareVariables(java.lang.String)
public void setGrouping(java.lang.String grouping)
setGrouping
in interface javax.jdo.Query
setGrouping
in class Query
grouping
- the grouping specification.Query.setGrouping(java.lang.String)
public void setOrdering(java.lang.String ordering)
This implementation always throws a JDOUserException since this concept doesn't apply to SQL queries.
setOrdering
in interface javax.jdo.Query
setOrdering
in class Query
ordering
- the ordering specification.
javax.jdo.JDOUserException
- Always thrown.Query.setOrdering(java.lang.String)
public void compile()
compile
in interface javax.jdo.Query
compile
in class Query
Query.compile()
protected abstract void generateQueryStatement()
public abstract java.util.Collection performExecute(java.util.Map parameters)
performExecute
in class Query
parameters
- the Map containing all of the parameters.
protected QueryResult getQueryResultForNoCandidateClass(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- The ResultSet
java.sql.SQLException
- Thrown when an error occurs creating the QueryResultprotected long performDeletePersistentAll(java.util.Map parameters)
performDeletePersistentAll
in class Query
parameters
- the Map containing all of the parameters.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |