internal virtual void Repeat(GremlinToSqlContext currentContext, GremlinToSqlContext repeatContext, RepeatCondition repeatCondition) { GremlinVariableType variableType = repeatContext.PivotVariable.GetVariableType() == GetVariableType() ? GetVariableType() : GremlinVariableType.Table; GremlinRepeatVariable repeatVariable = new GremlinRepeatVariable(this, repeatContext, repeatCondition, variableType); currentContext.VariableList.Add(repeatVariable); currentContext.TableReferences.Add(repeatVariable); currentContext.SetPivotVariable(repeatVariable); //TODO: refactor List <GremlinVariable> allTableVars = repeatVariable.FetchAllTableVars(); foreach (var variable in allTableVars) { var pathVariable = variable as GremlinGlobalPathVariable; if (pathVariable != null) { repeatVariable.PopulateLocalPath(); foreach (var property in pathVariable.ProjectedProperties) { repeatContext.ContextLocalPath.Populate(property); } pathVariable.IsInRepeatContext = true; pathVariable.PathList.Insert(pathVariable.PathList.FindLastIndex(p => p == repeatContext.StepList.First()), null); } } }
internal virtual void Repeat(GremlinToSqlContext currentContext, GremlinToSqlContext repeatContext, RepeatCondition repeatCondition) { GremlinTableVariable newVariable = GremlinRepeatVariable.Create(this, repeatContext, repeatCondition); currentContext.VariableList.Add(newVariable); currentContext.TableReferences.Add(newVariable); currentContext.SetPivotVariable(newVariable); }
internal virtual void Repeat(GremlinToSqlContext currentContext, GremlinToSqlContext repeatContext, RepeatCondition repeatCondition) { GremlinVariableType variableType = repeatContext.PivotVariable.GetVariableType() == GetVariableType() ? GetVariableType() : GremlinVariableType.Table; GremlinRepeatVariable newVariable = new GremlinRepeatVariable(this, repeatContext, repeatCondition, variableType); currentContext.VariableList.Add(newVariable); currentContext.TableReferences.Add(newVariable); currentContext.SetPivotVariable(newVariable); }