
public class OCommandExecutorSQLTraverse extends OCommandExecutorSQLResultsetAbstract
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 |
|---|---|
static String |
KEYWORD_MAXDEPTH |
static String |
KEYWORD_STRATEGY |
static String |
KEYWORD_TRAVERSE |
static String |
KEYWORD_WHILE |
compiledFilter, KEYWORD_FROM_2FIND, KEYWORD_LET_2FIND, lazyIteration, let, parsedTarget, request, resultCount, serialTempRID, skip, target, tempResultCLASS_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 |
|---|
OCommandExecutorSQLTraverse() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
assignTarget(Map<Object,Object> iArgs)
Assign the right TARGET if found.
|
Object |
execute(Map<Object,Object> iArgs)
Execute the requested command parsed previously.
|
OCommandContext |
getContext() |
OCommandDistributedReplicateRequest.QUORUM_TYPE |
getQuorumType()
Returns the quorum type for the command:
NONE: no quorum
READ: configured Read quorum
WRITE: configured Write quorum
ALL: all nodes
|
String |
getSyntax() |
Iterator<OIdentifiable> |
iterator() |
Iterator<OIdentifiable> |
iterator(Map<Object,Object> iArgs) |
OCommandExecutorSQLTraverse |
parse(OCommandRequest iRequest)
Compile the filter conditions only the first time.
|
protected int |
parseFields() |
protected boolean |
parseMaxDepth(String w) |
protected boolean |
parseStrategy(String w)
Parses the strategy keyword if found.
|
protected void |
warnDeprecatedWhere() |
applyLimitAndSkip, assignLetClauses, evaluateRecord, filter, getDistributedExecutionMode, getDistributedResultManagement, getRange, getResult, getResultInstance, getTarget, handleResult, isCacheable, isIdempotent, isLazyIteration, isUseCache, mergeResults, optimize, optimizeBranch, optimizeFunction, parseLet, parseLimit, parseSkip, pushResult, searchInClasses, searchInClasses, searchInClasses, searchInClusters, setCompiledFilter, setLazyIteration, setParsedTarget, setRequest, setTargetbindDefaultContextVariables, checkClusterAccess, decodeClassName, getInvolvedClustersOfClasses, getInvolvedClustersOfClusters, getInvolvedClustersOfIndex, parseLock, parseTimeout, preParse, throwParsingException, throwParsingException, throwSyntaxErrorExceptioncheckInterruption, checkInterruption, getDatabase, getDistributedTimeout, getFetchPlan, getInvolvedClusters, getLimit, getParameters, getProgressListener, getSecurityOperationType, getUndoCommand, init, involveSchema, isDistributedExecutingOnLocalNodeFirst, isLocalExecution, setContext, setLimit, setProgressListener, toString, upperCasegetLastWordLength, 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, getUndoCommand, isDistributedExecutingOnLocalNodeFirstforEach, spliteratorpublic static final String KEYWORD_WHILE
public static final String KEYWORD_TRAVERSE
public static final String KEYWORD_STRATEGY
public static final String KEYWORD_MAXDEPTH
public OCommandExecutorSQLTraverse parse(OCommandRequest iRequest)
parse in interface OCommandExecutorparse in class OCommandExecutorSQLResultsetAbstractiRequest - Command request implementation.#execute(Mapprotected boolean parseMaxDepth(String w) throws OCommandSQLParsingException
OCommandSQLParsingExceptionpublic Object execute(Map<Object,Object> iArgs)
OCommandExecutoriArgs - Optional variable arguments to pass to the command.OCommandExecutor.parse(OCommandRequest)public OCommandContext getContext()
getContext in interface OCommandExecutorgetContext in class OCommandExecutorAbstractpublic Iterator<OIdentifiable> iterator()
public Iterator<OIdentifiable> iterator(Map<Object,Object> iArgs)
public String getSyntax()
getSyntax in interface OCommandExecutorgetSyntax in class OBaseParserprotected void warnDeprecatedWhere()
protected boolean assignTarget(Map<Object,Object> iArgs)
OCommandExecutorSQLResultsetAbstractassignTarget in class OCommandExecutorSQLResultsetAbstractiArgs - Parameters to bindprotected int parseFields()
protected boolean parseStrategy(String w) throws OCommandSQLParsingException
OCommandSQLParsingExceptionpublic OCommandDistributedReplicateRequest.QUORUM_TYPE getQuorumType()
OCommandDistributedReplicateRequestCopyright © 2009–2025 OrientDB. All rights reserved.