org.objectweb.speedo.query.lib
Class SpeedoCompiledQuery
java.lang.Object
org.objectweb.speedo.query.lib.SpeedoCompiledQuery
- All Implemented Interfaces:
- org.objectweb.perseus.cache.api.CacheEntry, CompiledQuery, org.objectweb.perseus.cache.api.FixableCacheEntry, org.objectweb.perseus.cache.replacement.api.ReplaceableCacheEntry, org.objectweb.perseus.persistence.api.StateFilter
- public class SpeedoCompiledQuery
- extends java.lang.Object
- implements CompiledQuery, org.objectweb.perseus.persistence.api.StateFilter, org.objectweb.perseus.cache.replacement.api.ReplaceableCacheEntry
SpeedoCompiledQuery object represents a query. This object is created
when a new query is created, and can be used several times. A list of
SpeedoCompiledQuery is managed with a SpeedoQueryManager object.
When a user creates a new JDO Query object (SpeedoQuery), a
SpeedoCompiledQuery object is associated to the SpeedoQuery object which is
used to delegate some methods.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpeedoCompiledQuery
public SpeedoCompiledQuery()
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,
org.objectweb.medor.eval.prefetch.api.PrefetchBufferFactory pbf,
JormFactory _jf)
getMapper
public org.objectweb.jorm.api.PMapper getMapper()
setMapper
public void setMapper(org.objectweb.jorm.api.PMapper m)
setJormFactory
public void setJormFactory(JormFactory jf)
getLogger
public org.objectweb.util.monolog.api.Logger getLogger()
getQueryEvalContext
public QueryEvalContext[] getQueryEvalContext()
getPrefetchBufferFactory
public org.objectweb.medor.eval.prefetch.api.PrefetchBufferFactory getPrefetchBufferFactory()
isPrefetchResult
public boolean isPrefetchResult()
defineQuery
public void defineQuery(QueryDefinition _qd)
getCeAge
public long getCeAge()
- Specified by:
getCeAge
in interface org.objectweb.perseus.cache.replacement.api.ReplaceableCacheEntry
setCeAge
public void setCeAge(long _age)
- Specified by:
setCeAge
in interface org.objectweb.perseus.cache.replacement.api.ReplaceableCacheEntry
fixCe
public void fixCe()
- Specified by:
fixCe
in interface org.objectweb.perseus.cache.api.FixableCacheEntry
unfixCe
public void unfixCe()
throws org.objectweb.perseus.cache.api.UnFixProtocolException
- Specified by:
unfixCe
in interface org.objectweb.perseus.cache.api.FixableCacheEntry
- Throws:
org.objectweb.perseus.cache.api.UnFixProtocolException
getCeFixCount
public int getCeFixCount()
- Specified by:
getCeFixCount
in interface org.objectweb.perseus.cache.api.FixableCacheEntry
getCeObject
public java.lang.Object getCeObject()
- Specified by:
getCeObject
in interface org.objectweb.perseus.cache.api.CacheEntry
getCeIdentifier
public java.lang.Object getCeIdentifier()
- Specified by:
getCeIdentifier
in interface org.objectweb.perseus.cache.api.CacheEntry
getDefinition
public QueryDefinition getDefinition()
- Specified by:
getDefinition
in interface CompiledQuery
- 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
- compile the current SpeedoCompiledQuery.
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 CompiledQuery
- Throws:
SpeedoException
org.objectweb.medor.api.MedorException
org.objectweb.medor.expression.api.ExpressionException
execute
public java.lang.Object execute(java.lang.Object[] a,
ProxyManager pm,
QueryDefinition userqd)
throws SpeedoException,
org.objectweb.medor.api.MedorException,
org.objectweb.medor.expression.api.ExpressionException
- evaluate the query with a single parameter which is a array of object
parameters.
- Specified by:
execute
in interface CompiledQuery
- Parameters:
pm
- the persistence manager objecta
- the array parameter of the queryuserqd
- TODO
- Returns:
- a Collection of result objects
- Throws:
org.objectweb.medor.api.EvaluationException
org.objectweb.medor.api.MedorException
SpeedoException
org.objectweb.medor.expression.api.ExpressionException
execute
public java.lang.Object execute(java.util.Map m,
ProxyManager pm,
QueryDefinition userqd)
throws SpeedoException,
org.objectweb.medor.api.MedorException,
org.objectweb.medor.expression.api.ExpressionException
- evaluate the query with a single parameter which is a Map of object parameters.
- Specified by:
execute
in interface CompiledQuery
- Parameters:
pm
- the persistence manager objectm
- the map parameter of the query
- Returns:
- a Collection of result objects
- Throws:
org.objectweb.medor.api.EvaluationException
org.objectweb.medor.api.MedorException
SpeedoException
org.objectweb.medor.expression.api.ExpressionException
getStatus
public short getStatus()
- Specified by:
getStatus
in interface CompiledQuery
- Returns:
- the query status. The possible values are UNDEFINED, DEFINED
or COMPILED.
accept
public boolean accept(org.objectweb.perseus.persistence.api.State ce)
- Specified by:
accept
in interface org.objectweb.perseus.persistence.api.StateFilter