org.objectweb.speedo.query.jdo
Class JDOAbstractCompiledQuery

java.lang.Object
  extended by org.objectweb.speedo.query.lib.AbstractCompiledQuery
      extended by org.objectweb.speedo.query.jdo.JDOAbstractCompiledQuery
All Implemented Interfaces:
CacheEntry, FixableCacheEntry, ReplaceableCacheEntry, StateFilter, CompiledQuery
Direct Known Subclasses:
JDOCompiledDeleteQuery, JDOCompiledSelectQuery

public abstract class JDOAbstractCompiledQuery
extends AbstractCompiledQuery


Field Summary
protected  org.objectweb.util.monolog.api.Logger filterParserLogger
           
protected  java.util.Map hparams
          vparams, hparams and hvars are internal objects to manipulate the list of parameters, and the list of variables.
protected  java.util.Map hvars
           
protected  java.util.Map paramName2paramClass
           
protected  JDOQueryDefinitionImpl qd
          Fields from javax.jdo.Query
protected  org.objectweb.util.monolog.api.Logger varParserlogger
           
 
Fields inherited from class org.objectweb.speedo.query.lib.AbstractCompiledQuery
age, classLoader, fixCount, jf, logger, mapper, pncParams, prefetchBufferFactory, status, userCache, userCacheIndexes
 
Fields inherited from interface org.objectweb.speedo.query.api.CompiledQuery
COMPILED, DEFINED, UNDEFINED
 
Constructor Summary
JDOAbstractCompiledQuery()
           
 
Method Summary
 void defineQuery(JDOQueryDefinitionImpl _qd)
           
 java.lang.Object execute(java.util.Map m, POManagerItf pm, QueryDefinition userqd)
          evaluate the query with a single parameter which is a Map of object parameters.
 java.lang.Object execute(java.lang.Object[] a, POManagerItf pm, QueryDefinition userqd)
          evaluate the query with a single parameter which is a array of object parameters.
protected abstract  java.lang.Object executeQT(JDOPOManagerItf pm, org.objectweb.medor.expression.api.ParameterOperand[] pos, QueryDefinition userqd)
           
protected  void flushCache(JDOPOManagerItf pm)
           
 java.lang.Object getCeIdentifier()
           
protected  java.lang.Class getClass(java.lang.String classname)
           
 QueryDefinition getDefinition()
           
 void init(org.objectweb.util.monolog.api.Logger l, org.objectweb.util.monolog.api.Logger logParserVar, org.objectweb.util.monolog.api.Logger logParserFil, org.objectweb.jorm.api.PMapper m, PrefetchBufferFactory pbf, JormFactory _jf)
           
 boolean isPrefetchResult()
           
protected  QueryTree optimize(QueryTree qt, boolean debug)
           
 void setMapper(org.objectweb.jorm.api.PMapper m)
           
protected  void toHashtableParams(java.lang.String stringToHash, java.lang.String separator)
          Hash a String, and compute a Hashtable example: ("String name, Float salary, Employee boss", ",") keys | values --------------------- "name" | "String" "salary" | "Float" "boss" | "Employee"
protected  void toHashtableVars(java.lang.String stringToHash, java.lang.String separator)
           
protected  void treatParameter(org.objectweb.medor.expression.api.ParameterOperand po, java.lang.Object value)
           
 
Methods inherited from class org.objectweb.speedo.query.lib.AbstractCompiledQuery
accept, assignMapper, fixCe, getCeAge, getCeFixCount, getCeObject, getFieldComparaison, getLogger, getMapper, getPrefetchBufferFactory, getPType, getStatus, init, setCeAge, setJormFactory, unfixCe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.speedo.query.api.CompiledQuery
compile
 

Field Detail

qd

protected JDOQueryDefinitionImpl qd
Fields from javax.jdo.Query


hparams

protected java.util.Map hparams
vparams, hparams and hvars are internal objects to manipulate the list of parameters, and the list of variables.


paramName2paramClass

protected java.util.Map paramName2paramClass

hvars

protected java.util.Map hvars

varParserlogger

protected org.objectweb.util.monolog.api.Logger varParserlogger

filterParserLogger

protected org.objectweb.util.monolog.api.Logger filterParserLogger
Constructor Detail

JDOAbstractCompiledQuery

public JDOAbstractCompiledQuery()
Method Detail

executeQT

protected abstract java.lang.Object executeQT(JDOPOManagerItf pm,
                                              org.objectweb.medor.expression.api.ParameterOperand[] pos,
                                              QueryDefinition userqd)
                                       throws EvaluationException,
                                              MedorException,
                                              SpeedoException
Throws:
EvaluationException
MedorException
SpeedoException

init

public void init(org.objectweb.util.monolog.api.Logger l,
                 org.objectweb.util.monolog.api.Logger logParserVar,
                 org.objectweb.util.monolog.api.Logger logParserFil,
                 org.objectweb.jorm.api.PMapper m,
                 PrefetchBufferFactory pbf,
                 JormFactory _jf)

setMapper

public void setMapper(org.objectweb.jorm.api.PMapper m)
Specified by:
setMapper in class AbstractCompiledQuery

isPrefetchResult

public boolean isPrefetchResult()

defineQuery

public void defineQuery(JDOQueryDefinitionImpl _qd)

getCeIdentifier

public java.lang.Object getCeIdentifier()

getDefinition

public QueryDefinition getDefinition()
Returns:
the definition of the query if it is defined, null value otherwise.

optimize

protected QueryTree optimize(QueryTree qt,
                             boolean debug)
                      throws MedorException,
                             org.objectweb.medor.expression.api.ExpressionException
Throws:
MedorException
org.objectweb.medor.expression.api.ExpressionException

execute

public java.lang.Object execute(java.lang.Object[] a,
                                POManagerItf pm,
                                QueryDefinition userqd)
                         throws SpeedoException,
                                MedorException,
                                org.objectweb.medor.expression.api.ExpressionException
evaluate the query with a single parameter which is a array of object parameters.

Parameters:
pm - the persistence manager object
a - the array parameter of the query
userqd - TODO
Returns:
a Collection of result objects
Throws:
EvaluationException
MedorException
SpeedoException
org.objectweb.medor.expression.api.ExpressionException

execute

public java.lang.Object execute(java.util.Map m,
                                POManagerItf pm,
                                QueryDefinition userqd)
                         throws SpeedoException,
                                MedorException,
                                org.objectweb.medor.expression.api.ExpressionException
evaluate the query with a single parameter which is a Map of object parameters.

Parameters:
pm - the persistence manager object
m - the map parameter of the query
Returns:
a Collection of result objects
Throws:
EvaluationException
MedorException
SpeedoException
org.objectweb.medor.expression.api.ExpressionException

treatParameter

protected void treatParameter(org.objectweb.medor.expression.api.ParameterOperand po,
                              java.lang.Object value)
                       throws SpeedoException,
                              org.objectweb.medor.expression.api.ExpressionException
Throws:
SpeedoException
org.objectweb.medor.expression.api.ExpressionException

toHashtableParams

protected void toHashtableParams(java.lang.String stringToHash,
                                 java.lang.String separator)
Hash a String, and compute a Hashtable example: ("String name, Float salary, Employee boss", ",") keys | values --------------------- "name" | "String" "salary" | "Float" "boss" | "Employee"

Parameters:
stringToHash - the String to hash
separator - the separator to tokenize

toHashtableVars

protected void toHashtableVars(java.lang.String stringToHash,
                               java.lang.String separator)

getClass

protected java.lang.Class getClass(java.lang.String classname)

flushCache

protected void flushCache(JDOPOManagerItf pm)