org.objectweb.speedo.runtime.query
Class SpeedoQueryCompiler

org.objectweb.speedo.runtime.query.SpeedoQueryCompiler
All Implemented Interfaces:
QueryCompiler

public class SpeedoQueryCompiler
implements QueryCompiler

SpeedoQueryCompiler object represents a query. This object is created when a new query is created, and can be used several times. A list of SpeedoQueryCompiler is managed with a SpeedoQueryManager object. When a user creates a new JDO Query object (SpeedoQuery), a SpeedoQueryCompiler object is associated to the SpeedoQuery object which is used to delegate some methods.


Field Summary
static java.lang.String LOGGER_NAME
           
static java.lang.String PARSER_FILTER_LOGGER_NAME
           
static java.lang.String PARSER_LOGGER_NAME
           
static java.lang.String PARSER_VAR_LOGGER_NAME
           
 
Fields inherited from interface org.objectweb.speedo.runtime.query.api.QueryCompiler
COMPILED, DEFINED, UNDEFINED
 
Constructor Summary
SpeedoQueryCompiler()
           
 
Method Summary
 void compile()
          compile the current SpeedoQueryCompiler.
 void defineQuery(QueryDefinition qd)
           
 void destroy()
           
 java.util.Collection execute(java.util.Map m, ProxyManager pm)
          evaluate the query with a single parameter which is a Map of object parameters.
 java.util.Collection execute(java.lang.Object[] a, ProxyManager pm)
          evaluate the query with a single parameter which is a array of object parameters.
 org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
           
 org.objectweb.jorm.api.PMapper getMapper()
           
 short getStatus()
           
 void setJormFactory(JormFactory jf)
           
 void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory lf)
           
 void setMapper(org.objectweb.jorm.api.PMapper m)
           
 

Field Detail

LOGGER_NAME

public static final java.lang.String LOGGER_NAME

PARSER_LOGGER_NAME

public static final java.lang.String PARSER_LOGGER_NAME

PARSER_VAR_LOGGER_NAME

public static final java.lang.String PARSER_VAR_LOGGER_NAME

PARSER_FILTER_LOGGER_NAME

public static final java.lang.String PARSER_FILTER_LOGGER_NAME
Constructor Detail

SpeedoQueryCompiler

public SpeedoQueryCompiler()
Method Detail

getLoggerFactory

public org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()

setLoggerFactory

public void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory lf)

getMapper

public org.objectweb.jorm.api.PMapper getMapper()

setMapper

public void setMapper(org.objectweb.jorm.api.PMapper m)

setJormFactory

public void setJormFactory(JormFactory jf)

defineQuery

public void defineQuery(QueryDefinition qd)
                 throws SpeedoException

destroy

public void destroy()
             throws java.lang.Exception

compile

public void compile()
             throws SpeedoException,
                    org.objectweb.medor.api.MedorException
compile the current SpeedoQueryCompiler. The query is prepared to be executed. The PersistenceManager is set (even if there was a previous definition of a PersistenceManager.
Specified by:
compile in interface QueryCompiler

execute

public java.util.Collection execute(java.lang.Object[] a,
                                    ProxyManager pm)
                             throws SpeedoException,
                                    org.objectweb.medor.api.MedorException
evaluate the query with a single parameter which is a array of object parameters.
Specified by:
execute in interface QueryCompiler
Parameters:
a - the array parameter of the query
pm - the persistence manager object
Returns:
a Collection of result objects
Throws:
EvaluationException -  
MedorException -  

execute

public java.util.Collection execute(java.util.Map m,
                                    ProxyManager pm)
                             throws SpeedoException,
                                    org.objectweb.medor.api.MedorException
evaluate the query with a single parameter which is a Map of object parameters.
Specified by:
execute in interface QueryCompiler
Parameters:
m - the map parameter of the query
pm - the persistence manager object
Returns:
a Collection of result objects
Throws:
EvaluationException -  
MedorException -  

getStatus

public short getStatus()
Specified by:
getStatus in interface QueryCompiler