|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neodatis.odb.core.query.execution.GenericQueryExecutor
public abstract class GenericQueryExecutor
Generic query executor. This class does all the job of iterating in the object list and call particular query matching to check if the object must be included in the query result.
If the query has index, An execution plan is calculated to optimize the execution. The query execution plan is calculated by subclasses (using abstract method getExecutionPlan).
Field Summary | |
---|---|
protected IQueryExecutorCallback |
callback
|
protected ClassInfo |
classInfo
The class of the object being fetched |
protected NonNativeObjectInfo |
currentNnoi
|
protected OID |
currentOid
|
protected boolean |
executeStartAndEndOfQueryAction
Used for multi class executor to indicate not to execute start and end method of query result action |
static java.lang.String |
LOG_ID
|
protected OID |
nextOID
The next object position |
protected IObjectReader |
objectReader
The object used to read object data from database |
protected IQuery |
query
The query being executed |
protected ISession |
session
The current database session |
protected IStorageEngine |
storageEngine
The storage engine |
Constructor Summary | |
---|---|
GenericQueryExecutor(IQuery query,
IStorageEngine engine)
|
Method Summary | ||
---|---|---|
OdbComparable |
buildOrderByKey(AttributeValuesMap values)
|
|
OdbComparable |
buildOrderByKey(NonNativeObjectInfo nnoi)
|
|
OdbComparable |
buildOrderByKey(java.lang.Object object)
TODO very bad. |
|
abstract java.lang.Comparable |
computeIndexKey(ClassInfo ci,
ClassInfoIndex index)
|
|
|
execute(boolean inMemory,
int startIndex,
int endIndex,
boolean returnObjects,
IMatchingObjectAction queryResultAction)
The main query execution method |
|
boolean |
executeStartAndEndOfQueryAction()
Used to indicate if the execute method must call start and end method of the queryResultAction. |
|
abstract java.lang.Object |
getCurrentObjectMetaRepresentation()
This can be a NonNAtiveObjectInf or AttributeValuesMap |
|
abstract IQueryExecutionPlan |
getExecutionPlan()
|
|
abstract java.lang.String |
getFullClassName(IQuery query)
|
|
IQuery |
getQuery()
|
|
IStorageEngine |
getStorageEngine()
|
|
abstract boolean |
matchObjectWithOid(OID oid,
boolean loadObjectInfo,
boolean inMemory)
Check if the object with oid matches the query, returns true This method must compute the next object oid and the orderBy key if it exists! |
|
abstract void |
prepareQuery()
|
|
void |
setClassInfo(ClassInfo classInfo)
The class on which to execute the query |
|
void |
setExecuteStartAndEndOfQueryAction(boolean yes)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LOG_ID
protected IStorageEngine storageEngine
protected IQuery query
protected ClassInfo classInfo
protected IObjectReader objectReader
protected ISession session
protected OID nextOID
protected OID currentOid
protected NonNativeObjectInfo currentNnoi
protected IQueryExecutorCallback callback
protected boolean executeStartAndEndOfQueryAction
Constructor Detail |
---|
public GenericQueryExecutor(IQuery query, IStorageEngine engine)
Method Detail |
---|
public abstract IQueryExecutionPlan getExecutionPlan()
public abstract void prepareQuery()
public abstract java.lang.Comparable computeIndexKey(ClassInfo ci, ClassInfoIndex index)
public abstract java.lang.Object getCurrentObjectMetaRepresentation()
public abstract boolean matchObjectWithOid(OID oid, boolean loadObjectInfo, boolean inMemory)
oid
- The object positionloadObjectInfo
- To indicate if object must loaded (when the query indicator
'in memory' is false, we do not need to load object, only ids)inMemory
- To indicate if object must be actually loaded to memorypublic <T> Objects<T> execute(boolean inMemory, int startIndex, int endIndex, boolean returnObjects, IMatchingObjectAction queryResultAction)
IQueryExecutor
execute
in interface IQueryExecutor
public abstract java.lang.String getFullClassName(IQuery query)
getFullClassName
in interface IQueryExecutor
public OdbComparable buildOrderByKey(java.lang.Object object)
object
-
public OdbComparable buildOrderByKey(NonNativeObjectInfo nnoi)
public OdbComparable buildOrderByKey(AttributeValuesMap values)
public boolean executeStartAndEndOfQueryAction()
IMultiClassQueryExecutor
executeStartAndEndOfQueryAction
in interface IMultiClassQueryExecutor
public void setExecuteStartAndEndOfQueryAction(boolean yes)
setExecuteStartAndEndOfQueryAction
in interface IMultiClassQueryExecutor
public IStorageEngine getStorageEngine()
getStorageEngine
in interface IMultiClassQueryExecutor
public IQuery getQuery()
getQuery
in interface IMultiClassQueryExecutor
public void setClassInfo(ClassInfo classInfo)
IMultiClassQueryExecutor
setClassInfo
in interface IMultiClassQueryExecutor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |