com.triactive.jdo.store.query
Class TjdoSqlQuery

java.lang.Object
  extended bycom.triactive.jdo.store.query.Query
      extended bycom.triactive.jdo.store.query.TjdoSqlQuery
All Implemented Interfaces:
javax.jdo.Query, Query, java.io.Serializable

public class TjdoSqlQuery
extends Query

A JDO query that uses raw SQL, possibly with embedded macros.

Author:
Mike Martin
See Also:
Query, Serialized Form

Field Summary
 
Fields inherited from class com.triactive.jdo.store.query.Query
candidateClass, dba, extensions, filter, grouping, imports, isPart1Compiled, ordering, parameterNames, parameters, parameterTypesByName, parsedImports, pm, queryResults, result, resultClass, storeMgr, unique, variableNames, variables, variableTypesByName
 
Constructor Summary
TjdoSqlQuery(PersistenceManager pm, java.lang.String tjdoSqlText)
          Constructs a new query instance having the same criteria as the given query.
 
Method Summary
 void declareVariables(java.lang.String variables)
          Declare the unbound variables to be used in the query.
protected  void discardCompiled()
           
protected  boolean effectiveUniqueSetting()
           
 boolean equals(java.lang.Object obj)
           
 java.lang.Object executeWithMap(java.util.Map parameters)
          Execute the query and return the filtered Collection.
protected  ResultExpression getResultExpression(java.sql.ResultSetMetaData rsmd)
           
protected  StatementText getStatementText()
           
 int hashCode()
           
 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 expressions, optionally including a "having" clause.
 void setOrdering(java.lang.String ordering)
          Set the ordering specification for the result Collection.
 void setResult(java.lang.String result)
          Specifies what type of data this query should return.
 
Methods inherited from class com.triactive.jdo.store.query.Query
addExtension, close, closeAll, compile, declareImports, declareParameters, effectiveFetchSize, effectiveResultSetType, execute, execute, execute, execute, executeWithArray, getCandidateClass, getIgnoreCache, getPersistenceManager, getStoreManager, isKnownExtensionKey, isValidJavaIdentifier, resolveClassDeclaration, setClass, setExtensions, setIgnoreCache, setResultClass, setUnique
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TjdoSqlQuery

public TjdoSqlQuery(PersistenceManager pm,
                    java.lang.String tjdoSqlText)
Constructs a new query instance having the same criteria as the given query.

Parameters:
pm - the associated persistence manager for this query
tjdoSqlText - the SQL text of the query
Method Detail

discardCompiled

protected void discardCompiled()
Overrides:
discardCompiled in class Query

hashCode

public int hashCode()
Overrides:
hashCode in class Query

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Query

setCandidates

public void setCandidates(javax.jdo.Extent pcs)
Set the candidate Extent to query.

This implementation always throws a JDOUserException since this concept doesn't apply to TJDOSQL queries.

Specified by:
setCandidates in interface javax.jdo.Query
Specified by:
setCandidates in class Query
Parameters:
pcs - the Candidate Extent.
Throws:
javax.jdo.JDOUserException - Always thrown.
See Also:
Query.setCandidates(javax.jdo.Extent)

setCandidates

public void setCandidates(java.util.Collection pcs)
Set the candidate Collection to query.

This implementation always throws a JDOUserException since this concept doesn't apply to TJDOSQL queries.

Specified by:
setCandidates in interface javax.jdo.Query
Specified by:
setCandidates in class Query
Parameters:
pcs - the Candidate collection.
Throws:
javax.jdo.JDOUserException - Always thrown.
See Also:
Query.setCandidates(java.util.Collection)

setFilter

public void setFilter(java.lang.String filter)
Set the filter for the query.

This implementation always throws a JDOUserException since this concept doesn't apply to TJDOSQL queries.

Specified by:
setFilter in interface javax.jdo.Query
Overrides:
setFilter in class Query
Parameters:
filter - the query filter.
Throws:
javax.jdo.JDOUserException - Always thrown.
See Also:
Query.setFilter(java.lang.String)

declareVariables

public void declareVariables(java.lang.String variables)
Declare the unbound variables to be used in the query.

This implementation always throws a JDOUserException since this concept doesn't apply to TJDOSQL queries.

Specified by:
declareVariables in interface javax.jdo.Query
Overrides:
declareVariables in class Query
Parameters:
variables - the variables separated by semicolons.
Throws:
javax.jdo.JDOUserException - Always thrown.
See Also:
Query.declareVariables(java.lang.String)

setOrdering

public void setOrdering(java.lang.String ordering)
Set the ordering specification for the result Collection.

This implementation always throws a JDOUserException since this concept doesn't apply to TJDOSQL queries.

Specified by:
setOrdering in interface javax.jdo.Query
Overrides:
setOrdering in class Query
Parameters:
ordering - the ordering specification.
Throws:
javax.jdo.JDOUserException - Always thrown.
See Also:
Query.setOrdering(java.lang.String)

setResult

public void setResult(java.lang.String result)
Specifies what type of data this query should return.

This implementation always throws a JDOUserException since this concept doesn't apply to TJDOSQL queries.

Specified by:
setResult in interface Query
Overrides:
setResult in class Query
Parameters:
result - a comma-delimited list of expressions (fields, functions on fields, or aggregate functions) to return from this query.
Throws:
javax.jdo.JDOUserException - Always thrown.
See Also:
Query.setResult(java.lang.String)

setGrouping

public void setGrouping(java.lang.String grouping)
Set the grouping expressions, optionally including a "having" clause.

This implementation always throws a JDOUserException since this concept doesn't apply to TJDOSQL queries.

Specified by:
setGrouping in interface Query
Overrides:
setGrouping in class Query
Parameters:
grouping - a comma-delimited list of expressions, optionally followed by the "having" keyword and a boolean expression.
Throws:
javax.jdo.JDOUserException - Always thrown.
See Also:
Query.setGrouping(java.lang.String)

executeWithMap

public java.lang.Object executeWithMap(java.util.Map parameters)
Execute the query and return the filtered Collection.

Specified by:
executeWithMap in interface javax.jdo.Query
Specified by:
executeWithMap in class Query
Parameters:
parameters - the Map containing all of the parameters.
Returns:
the filtered Collection.
See Also:
Query.executeWithMap(Map), Query.executeWithArray(Object[] parameters)

getStatementText

protected StatementText getStatementText()
Specified by:
getStatementText in class Query

getResultExpression

protected ResultExpression getResultExpression(java.sql.ResultSetMetaData rsmd)
                                        throws java.sql.SQLException
Specified by:
getResultExpression in class Query
Throws:
java.sql.SQLException

effectiveUniqueSetting

protected boolean effectiveUniqueSetting()
Specified by:
effectiveUniqueSetting in class Query


Copyright © 2001-2007 The TJDO Project All Rights Reserved.