internal virtual void Has(GremlinToSqlContext currentContext, string propertyKey) { GraphTraversal2 traversal2 = GraphTraversal2.__().Properties(propertyKey); traversal2.GetStartOp().InheritedVariableFromParent(currentContext); currentContext.AddPredicate(SqlUtil.GetExistPredicate(traversal2.GetEndOp().GetContext().ToSelectQueryBlock())); }
internal WBooleanExpression ToSqlBoolean() { if (this.TableReferencesInFromClause.Count == 0) { return(this.Predicates); } return(SqlUtil.GetExistPredicate(this.ToSelectQueryBlock())); }
internal WBooleanExpression ToSqlBoolean() { if (TableReferences.Count == 0) { return(Predicates); } return(SqlUtil.GetExistPredicate(ToSelectQueryBlock())); }
internal WBooleanExpression ToSqlBoolean() { if (TableReferences.Count == 0) { if (Predicates != null) { return(SqlUtil.GetBooleanParenthesisExpr(Predicates)); } return(null); } else { return(SqlUtil.GetExistPredicate(ToSelectQueryBlock())); } }
/// <summary> /// Only valid for VertexProperty /// </summary> internal virtual void HasKeyOrValue(GremlinToSqlContext currentContext, GremlinHasType hasType, List <object> valuesOrPredicates) { GraphTraversal2 traversal2 = hasType == GremlinHasType.HasKey ? GraphTraversal2.__().Key() : GraphTraversal2.__().Value(); traversal2.GetStartOp().InheritedVariableFromParent(currentContext); GremlinToSqlContext existContext = traversal2.GetEndOp().GetContext(); List <WBooleanExpression> booleanExprList = new List <WBooleanExpression>(); GremlinVariableProperty defaultVariableProperty = existContext.PivotVariable.DefaultProjection(); foreach (var valuesOrPredicate in valuesOrPredicates) { booleanExprList.Add(CreateBooleanExpression(defaultVariableProperty, valuesOrPredicate)); } existContext.AddPredicate(SqlUtil.ConcatBooleanExprWithOr(booleanExprList)); currentContext.AddPredicate(SqlUtil.GetExistPredicate(existContext.ToSelectQueryBlock())); }