org.xorm.query
Class AbstractQueryLanguage

java.lang.Object
  |
  +--org.xorm.query.AbstractQueryLanguage
All Implemented Interfaces:
Cloneable, QueryLanguage
Direct Known Subclasses:
DataQuery, JDOQL

public abstract class AbstractQueryLanguage
extends Object
implements QueryLanguage

Implementation of QueryLanguage interface that provides common methods to set and get variables and parameters.


Field Summary
protected  Class clazz
           
protected  LinkedHashMap paramNameToType
           
protected  HashMap varNameToType
           
 
Fields inherited from interface org.xorm.query.QueryLanguage
LANGUAGE
 
Constructor Summary
AbstractQueryLanguage()
           
 
Method Summary
 void addOrdering(QueryOrdering ordering)
           
abstract  void compile()
          A hint that the implementation should undertake the work of generating the Expression object now for future use.
 void declareParameter(String name, Class type)
           
 void declareVariable(String name, Class type)
           
 Class getCandidateClass()
          Gets the class of candidate instances for the query.
abstract  Expression getExpression()
          Returns the query expression generated by this object.
 QueryOrdering[] getOrdering()
          Gets the ordering that should be used in returning the values.
 List getParameterNames()
          Guaranteed to come out in the same order they went in.
 Class getParameterType(String name)
           
 Set getVariableNames()
           
 Class getVariableType(String name)
           
 void setClass(Class clazz)
           
abstract  void setFilter(Object filter)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

clazz

protected Class clazz

paramNameToType

protected LinkedHashMap paramNameToType

varNameToType

protected HashMap varNameToType
Constructor Detail

AbstractQueryLanguage

public AbstractQueryLanguage()
Method Detail

getExpression

public abstract Expression getExpression()
Description copied from interface: QueryLanguage
Returns the query expression generated by this object. This method may return null if compile() has not been called.

Specified by:
getExpression in interface QueryLanguage

compile

public abstract void compile()
                      throws QuerySyntaxException
Description copied from interface: QueryLanguage
A hint that the implementation should undertake the work of generating the Expression object now for future use.

Specified by:
compile in interface QueryLanguage
QuerySyntaxException

setFilter

public abstract void setFilter(Object filter)

setClass

public void setClass(Class clazz)

getCandidateClass

public Class getCandidateClass()
Description copied from interface: QueryLanguage
Gets the class of candidate instances for the query.

Specified by:
getCandidateClass in interface QueryLanguage

declareVariable

public void declareVariable(String name,
                            Class type)

declareParameter

public void declareParameter(String name,
                             Class type)

getParameterNames

public List getParameterNames()
Guaranteed to come out in the same order they went in.


getParameterType

public Class getParameterType(String name)

getVariableNames

public Set getVariableNames()

getVariableType

public Class getVariableType(String name)

toString

public String toString()
Overrides:
toString in class Object

getOrdering

public QueryOrdering[] getOrdering()
Description copied from interface: QueryLanguage
Gets the ordering that should be used in returning the values.

Specified by:
getOrdering in interface QueryLanguage

addOrdering

public void addOrdering(QueryOrdering ordering)


$Header: /cvsroot/xorm/xorm/docs/api/org/xorm/query/AbstractQueryLanguage.html,v 1.2 2004/05/30 08:55:07 wbiggs Exp $