
public abstract class OCommandExecutorSQLResultsetAbstract extends OCommandExecutorSQLAbstract implements OCommandDistributedReplicateRequest, Iterable<OIdentifiable>, OIterableRecordSource
SYNTAX: TRAVERSE
In the command context you've access to the variable $depth containing the depth level from
the root node. This is useful to limit the traverse up to a level. For example to consider from
the first depth level (0 is root node) to the third use:
TRAVERSE children FROM #5:23 WHERE $depth BETWEEN 1 AND 3. To filter traversed records use
it combined with a SELECT statement:
SELECT FROM (TRAVERSE children FROM #5:23 WHERE $depth BETWEEN 1 AND 3) WHERE city.name = 'Rome'
OCommandDistributedReplicateRequest.DISTRIBUTED_EXECUTION_MODE, OCommandDistributedReplicateRequest.DISTRIBUTED_RESULT_MGMT, OCommandDistributedReplicateRequest.QUORUM_TYPE| Modifier and Type | Field and Description |
|---|---|
protected OSQLFilter |
compiledFilter |
protected static String |
KEYWORD_FROM_2FIND |
protected static String |
KEYWORD_LET_2FIND |
protected boolean |
lazyIteration |
protected Map<String,Object> |
let |
protected OSQLTarget |
parsedTarget |
protected OSQLAsynchQuery<ODocument> |
request |
protected int |
resultCount |
protected AtomicInteger |
serialTempRID |
protected int |
skip |
protected Iterator<? extends OIdentifiable> |
target |
protected Iterable<OIdentifiable> |
tempResult |
CLASS_PREFIX, CLUSTER_PREFIX, DEFAULT_PARAM_USER, DICTIONARY_PREFIX, INDEX_PREFIX, INDEX_VALUES_ASC_PREFIX, INDEX_VALUES_DESC_PREFIX, INDEX_VALUES_PREFIX, KEYWORD_FROM, KEYWORD_KEY, KEYWORD_LET, KEYWORD_LIMIT, KEYWORD_LOCK, KEYWORD_OFFSET, KEYWORD_RETURN, KEYWORD_RID, KEYWORD_SKIP, KEYWORD_TIMEOUT, KEYWORD_UNSAFE, KEYWORD_WHERE, METADATA_DATABASE, METADATA_INDEXMGR, METADATA_PREFIX, METADATA_SCHEMA, METADATA_STORAGE, preParsedStatement, timeoutMs, timeoutStrategycontext, limit, parameters, progressListenerparserText, parserTextUpperCase| Constructor and Description |
|---|
OCommandExecutorSQLResultsetAbstract() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyLimitAndSkip() |
protected void |
assignLetClauses(ORecord iRecord) |
protected boolean |
assignTarget(Map<Object,Object> iArgs)
Assign the right TARGET if found.
|
protected boolean |
evaluateRecord(ORecord iRecord,
OCommandContext iContext) |
protected boolean |
filter(ORecord iRecord,
OCommandContext iContext) |
OCommandDistributedReplicateRequest.DISTRIBUTED_EXECUTION_MODE |
getDistributedExecutionMode()
The command is replicated
|
OCommandDistributedReplicateRequest.DISTRIBUTED_RESULT_MGMT |
getDistributedResultManagement()
Returns how to manage the distributed result between:
CHECK_FOR_EQUALS: all results must be the same
MERGE: merges results.
|
protected ORID[] |
getRange() |
protected Object |
getResult() |
protected Object |
getResultInstance() |
Iterator<? extends OIdentifiable> |
getTarget() |
protected boolean |
handleResult(OIdentifiable iRecord,
OCommandContext iContext) |
boolean |
isCacheable()
Returns true if the command results can be cached.
|
boolean |
isIdempotent()
Returns true if the command doesn't change the database, otherwise false.
|
boolean |
isLazyIteration() |
protected boolean |
isUseCache() |
Object |
mergeResults(Map<String,Object> results) |
protected void |
optimize()
Optimizes the condition tree.
|
protected void |
optimizeBranch(OSQLFilterCondition iParentCondition,
OSQLFilterCondition iCondition) |
protected Object |
optimizeFunction(OSQLFunctionRuntime function)
Check function arguments and pre calculate it if possible
|
OCommandExecutorSQLResultsetAbstract |
parse(OCommandRequest iRequest)
Compile the filter conditions only the first time.
|
protected void |
parseLet() |
protected int |
parseLimit(String w)
Parses the limit keyword if found.
|
protected int |
parseSkip(String w)
Parses the skip keyword if found.
|
protected boolean |
pushResult(Object rec) |
protected void |
searchInClasses() |
protected void |
searchInClasses(boolean iAscendentOrder) |
protected Iterator<? extends OIdentifiable> |
searchInClasses(OClass iCls,
boolean iPolymorphic,
boolean iAscendentOrder) |
protected void |
searchInClusters() |
void |
setCompiledFilter(OSQLFilter compiledFilter) |
void |
setLazyIteration(boolean lazyIteration) |
void |
setParsedTarget(OSQLTarget parsedTarget) |
void |
setRequest(OSQLAsynchQuery<ODocument> request) |
void |
setTarget(Iterator<? extends OIdentifiable> target) |
bindDefaultContextVariables, checkClusterAccess, decodeClassName, getInvolvedClustersOfClasses, getInvolvedClustersOfClusters, getInvolvedClustersOfIndex, parseLock, parseTimeout, preParse, throwParsingException, throwParsingException, throwSyntaxErrorExceptioncheckInterruption, checkInterruption, getContext, getDatabase, getDistributedTimeout, getFetchPlan, getInvolvedClusters, getLimit, getParameters, getProgressListener, getSecurityOperationType, getUndoCommand, init, involveSchema, isDistributedExecutingOnLocalNodeFirst, isLocalExecution, setContext, setLimit, setProgressListener, toString, upperCasegetLastWordLength, getSyntax, getWordStatic, nextWord, nextWord, parseOptionalWord, parserGetCurrentChar, parserGetCurrentPosition, parserGetLastSeparator, parserGetLastWord, parserGetPreviousPosition, parserGoBack, parserIsEnded, parserMoveCurrentPosition, parserNextChars, parserNextWord, parserNextWord, parserNextWord, parserOptionalKeyword, parserOptionalWord, parserRequiredKeyword, parserRequiredWord, parserRequiredWord, parserRequiredWord, parserSetCurrentPosition, parserSetEndOfText, parserSetLastSeparator, parserSkipWhiteSpacesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDistributedTimeout, getQuorumType, getUndoCommand, isDistributedExecutingOnLocalNodeFirstforEach, iterator, spliteratoriteratorexecute, getSyntaxprotected static final String KEYWORD_FROM_2FIND
protected static final String KEYWORD_LET_2FIND
protected OSQLAsynchQuery<ODocument> request
protected OSQLTarget parsedTarget
protected OSQLFilter compiledFilter
protected Iterator<? extends OIdentifiable> target
protected Iterable<OIdentifiable> tempResult
protected int resultCount
protected AtomicInteger serialTempRID
protected int skip
protected boolean lazyIteration
public OCommandExecutorSQLResultsetAbstract()
public OCommandExecutorSQLResultsetAbstract parse(OCommandRequest iRequest)
parse in interface OCommandExecutoriRequest - Command request implementation.#execute(Mappublic boolean isIdempotent()
OCommandExecutorisIdempotent in interface OCommandExecutorisIdempotent in class OCommandExecutorSQLAbstractpublic boolean isLazyIteration()
public void setLazyIteration(boolean lazyIteration)
public OCommandDistributedReplicateRequest.DISTRIBUTED_EXECUTION_MODE getDistributedExecutionMode()
OCommandExecutorSQLAbstractgetDistributedExecutionMode in interface OCommandDistributedReplicateRequestgetDistributedExecutionMode in class OCommandExecutorSQLAbstractpublic OCommandDistributedReplicateRequest.DISTRIBUTED_RESULT_MGMT getDistributedResultManagement()
OCommandDistributedReplicateRequestgetDistributedResultManagement in interface OCommandDistributedReplicateRequestgetDistributedResultManagement in class OCommandExecutorAbstractprotected boolean assignTarget(Map<Object,Object> iArgs)
iArgs - Parameters to bindprotected Object getResultInstance()
protected Object getResult()
protected boolean pushResult(Object rec)
protected boolean handleResult(OIdentifiable iRecord, OCommandContext iContext)
protected void parseLet()
protected int parseLimit(String w) throws OCommandSQLParsingException
w - OCommandSQLParsingException - if no valid limit has been foundprotected int parseSkip(String w) throws OCommandSQLParsingException
w - OCommandSQLParsingException - if no valid skip has been foundprotected boolean filter(ORecord iRecord, OCommandContext iContext)
protected boolean evaluateRecord(ORecord iRecord, OCommandContext iContext)
protected void assignLetClauses(ORecord iRecord)
protected void searchInClasses()
protected void searchInClasses(boolean iAscendentOrder)
protected Iterator<? extends OIdentifiable> searchInClasses(OClass iCls, boolean iPolymorphic, boolean iAscendentOrder)
protected boolean isUseCache()
protected void searchInClusters()
protected void applyLimitAndSkip()
protected void optimize()
protected Object optimizeFunction(OSQLFunctionRuntime function)
function - protected void optimizeBranch(OSQLFilterCondition iParentCondition, OSQLFilterCondition iCondition)
protected ORID[] getRange()
public Iterator<? extends OIdentifiable> getTarget()
public void setTarget(Iterator<? extends OIdentifiable> target)
public void setRequest(OSQLAsynchQuery<ODocument> request)
public void setParsedTarget(OSQLTarget parsedTarget)
public void setCompiledFilter(OSQLFilter compiledFilter)
public boolean isCacheable()
OCommandExecutorisCacheable in interface OCommandExecutorisCacheable in class OCommandExecutorAbstractpublic Object mergeResults(Map<String,Object> results) throws Exception
mergeResults in interface OCommandExecutormergeResults in class OCommandExecutorAbstractExceptionCopyright © 2009–2025 OrientDB. All rights reserved.