示例#1
0
        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()));
        }
示例#2
0
 internal WBooleanExpression ToSqlBoolean()
 {
     if (this.TableReferencesInFromClause.Count == 0)
     {
         return(this.Predicates);
     }
     return(SqlUtil.GetExistPredicate(this.ToSelectQueryBlock()));
 }
示例#3
0
 internal WBooleanExpression ToSqlBoolean()
 {
     if (TableReferences.Count == 0)
     {
         return(Predicates);
     }
     return(SqlUtil.GetExistPredicate(ToSelectQueryBlock()));
 }
示例#4
0
 internal WBooleanExpression ToSqlBoolean()
 {
     if (TableReferences.Count == 0)
     {
         if (Predicates != null)
         {
             return(SqlUtil.GetBooleanParenthesisExpr(Predicates));
         }
         return(null);
     }
     else
     {
         return(SqlUtil.GetExistPredicate(ToSelectQueryBlock()));
     }
 }
示例#5
0
        /// <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()));
        }