Пример #1
0
        internal void HasLabel(GremlinVariable lastVariable, List <object> values)
        {
            List <WBooleanExpression> booleanExprList = new List <WBooleanExpression>();

            foreach (var value in values)
            {
                WScalarExpression firstExpr  = lastVariable.GetVariableProperty(GremlinKeyword.Label).ToScalarExpression();
                WScalarExpression secondExpr = SqlUtil.GetValueExpr(value);
                booleanExprList.Add(SqlUtil.GetEqualBooleanComparisonExpr(firstExpr, secondExpr));
            }
            WBooleanExpression concatSql = SqlUtil.ConcatBooleanExprWithOr(booleanExprList);

            AddPredicate(SqlUtil.GetBooleanParenthesisExpr(concatSql));
        }
Пример #2
0
 internal WBooleanExpression ToSqlBoolean()
 {
     if (TableReferences.Count == 0)
     {
         if (Predicates != null)
         {
             return(SqlUtil.GetBooleanParenthesisExpr(Predicates));
         }
         return(null);
     }
     else
     {
         return(SqlUtil.GetExistPredicate(ToSelectQueryBlock()));
     }
 }
Пример #3
0
        internal void AddLabelPredicateForEdge(GremlinEdgeTableVariable edgeTable, List <string> edgeLabels)
        {
            if (edgeLabels.Count == 0)
            {
                return;
            }
            List <WBooleanExpression> booleanExprList = new List <WBooleanExpression>();

            foreach (var edgeLabel in edgeLabels)
            {
                var firstExpr  = edgeTable.GetVariableProperty(GremlinKeyword.Label).ToScalarExpression();
                var secondExpr = SqlUtil.GetValueExpr(edgeLabel);
                booleanExprList.Add(SqlUtil.GetEqualBooleanComparisonExpr(firstExpr, secondExpr));
            }
            AddPredicate(SqlUtil.GetBooleanParenthesisExpr(SqlUtil.ConcatBooleanExprWithOr(booleanExprList)));
        }