org.objectweb.speedo.query.api
Interface CompiledQuery

All Known Implementing Classes:
SpeedoCompiledQuery

public interface CompiledQuery

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, ProxyManager pm, QueryDefinition qd)
           
 java.lang.Object execute(java.lang.Object[] parameters, ProxyManager pm, QueryDefinition qd)
          Executes the compiled query.
 QueryDefinition getDefinition()
           
 short getStatus()
           
 

Field Detail

UNDEFINED

public static final short UNDEFINED
See Also:
Constant Field Values

DEFINED

public static final short DEFINED
See Also:
Constant Field Values

COMPILED

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

getStatus

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

getDefinition

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

compile

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

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

execute

public java.lang.Object execute(java.lang.Object[] parameters,
                                ProxyManager pm,
                                QueryDefinition qd)
                         throws SpeedoException,
                                org.objectweb.medor.api.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 proxy 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
org.objectweb.medor.api.MedorException
org.objectweb.medor.expression.api.ExpressionException

execute

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