org.objectweb.speedo.query.api
Interface CompiledQuery

All Superinterfaces:
CacheEntry, FixableCacheEntry
All Known Implementing Classes:
AbstractCompiledQuery, EJBCompiledQuery, JDOAbstractCompiledQuery, JDOCompiledDeleteQuery, JDOCompiledSelectQuery

public interface CompiledQuery
extends FixableCacheEntry

Represents a compiled JDO query.

Author:
S.Chassande-Barrioz

Field Summary
static short COMPILED
           
static short DEFINED
           
static short UNDEFINED
           
 
Method Summary
 void compile()
          Compiles the query if it is not already done.
 java.lang.Object execute(java.util.Map parameters, POManagerItf pm, QueryDefinition qd)
           
 java.lang.Object execute(java.lang.Object[] parameters, POManagerItf pm, QueryDefinition qd)
          Executes the compiled query.
 QueryDefinition getDefinition()
           
 short getStatus()
           
 
Methods inherited from interface org.objectweb.perseus.cache.api.FixableCacheEntry
fixCe, getCeFixCount, unfixCe
 
Methods inherited from interface org.objectweb.perseus.cache.api.CacheEntry
getCeIdentifier, getCeObject
 

Field Detail

UNDEFINED

static final short UNDEFINED
See Also:
Constant Field Values

DEFINED

static final short DEFINED
See Also:
Constant Field Values

COMPILED

static final short COMPILED
See Also:
Constant Field Values
Method Detail

getStatus

short getStatus()
Returns:
the query status. The possible values are UNDEFINED, DEFINED or COMPILED.

getDefinition

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

compile

void compile()
             throws SpeedoException,
                    MedorException,
                    org.objectweb.medor.expression.api.ExpressionException
Compiles the query if it is not already done.

Throws:
SpeedoException
MedorException
org.objectweb.medor.expression.api.ExpressionException

execute

java.lang.Object execute(java.lang.Object[] parameters,
                         POManagerItf pm,
                         QueryDefinition qd)
                         throws SpeedoException,
                                MedorException,
                                org.objectweb.medor.expression.api.ExpressionException
Executes the compiled query.

Parameters:
parameters - is the JDO parameters of query (does not contains internal parameter). The order of parameter must match the parameter declaration.
pm - is the po manager representing the execution context. It also used to load the instance in the result collection.
qd - TODO
Returns:
a list or one persistent instance depending on the unique flag. The result can be null only if the result is unique.
Throws:
SpeedoException
MedorException
org.objectweb.medor.expression.api.ExpressionException

execute

java.lang.Object execute(java.util.Map parameters,
                         POManagerItf pm,
                         QueryDefinition qd)
                         throws SpeedoException,
                                MedorException,
                                org.objectweb.medor.expression.api.ExpressionException
Throws:
SpeedoException
MedorException
org.objectweb.medor.expression.api.ExpressionException