public virtual bool Visit(Net.Vpc.Upa.Expressions.Expression expression, Net.Vpc.Upa.Expressions.ExpressionTag tag)
 {
     foreach (Net.Vpc.Upa.Expressions.TaggedExpression cc in expression.GetChildren())
     {
         Net.Vpc.Upa.Expressions.Expression cce = cc.GetExpression();
         if (cce != null)
         {
             if (cce is Net.Vpc.Upa.Expressions.UserExpression)
             {
                 Net.Vpc.Upa.Expressions.Expression rr = expressionManager.ParseExpression(cce);
                 rr.Visit(this);
                 expression.SetChild(rr, cc.GetTag());
             }
             else if (cce is Net.Vpc.Upa.Expressions.Var)
             {
                 Net.Vpc.Upa.Expressions.Var v = (Net.Vpc.Upa.Expressions.Var)cce;
                 if (v.GetApplier() == null && v.GetName().Equals("this"))
                 {
                     v.SetName(thisName);
                 }
             }
         }
     }
     return(true);
 }
Beispiel #2
0
 public static Net.Vpc.Upa.Expressions.Expression ParseUserExpressions(Net.Vpc.Upa.Expressions.Expression expression, Net.Vpc.Upa.PersistenceUnit pu)
 {
     if (expression is Net.Vpc.Upa.Expressions.UserExpression)
     {
         return(pu.GetExpressionManager().ParseExpression((Net.Vpc.Upa.Expressions.UserExpression)expression));
     }
     Net.Vpc.Upa.Impl.Uql.Util.UserExpressionParserVisitor v = new Net.Vpc.Upa.Impl.Uql.Util.UserExpressionParserVisitor(pu.GetExpressionManager());
     expression.Visit(v);
     return(expression);
 }
Beispiel #3
0
 public virtual Net.Vpc.Upa.Expressions.Expression ParseExpression(Net.Vpc.Upa.Expressions.Expression expression)
 {
     if (expression is Net.Vpc.Upa.Expressions.UserExpression)
     {
         Net.Vpc.Upa.Expressions.UserExpression ucce = (Net.Vpc.Upa.Expressions.UserExpression)expression;
         Net.Vpc.Upa.Expressions.Expression     expr = ParseExpression(ucce.GetExpression());
         expr.Visit(new Net.Vpc.Upa.Impl.Uql.Util.UserExpressionParametersMatcherVisitor(ucce));
         return(expr);
     }
     else
     {
         Net.Vpc.Upa.Impl.Uql.Util.UserExpressionParserVisitor v = new Net.Vpc.Upa.Impl.Uql.Util.UserExpressionParserVisitor(this);
         expression.Visit(v);
         return(expression);
     }
 }
 public virtual bool Visit(Net.Vpc.Upa.Expressions.Expression expression, Net.Vpc.Upa.Expressions.ExpressionTag tag)
 {
     foreach (Net.Vpc.Upa.Expressions.TaggedExpression cc in expression.GetChildren())
     {
         Net.Vpc.Upa.Expressions.Expression cce = cc.GetExpression();
         if (cce != null)
         {
             if (cce is Net.Vpc.Upa.Expressions.UserExpression)
             {
                 Net.Vpc.Upa.Expressions.UserExpression ucce = (Net.Vpc.Upa.Expressions.UserExpression)cce;
                 Net.Vpc.Upa.Expressions.Expression     expr = expressionManager.ParseExpression(ucce.GetExpression());
                 expr.Visit(new Net.Vpc.Upa.Impl.Uql.Util.UserExpressionParametersMatcherVisitor(ucce));
                 expression.SetChild(expr, cc.GetTag());
             }
         }
     }
     return(true);
 }
        public virtual Net.Vpc.Upa.Expressions.Expression CreateTargetListExpression(object currentInstance, string alias)
        {
            if (filter == null)
            {
                return(null);
            }
            System.Collections.Generic.Dictionary <string, object> v = new System.Collections.Generic.Dictionary <string, object>();
            v["this"] = currentInstance;
            if (Net.Vpc.Upa.Impl.Util.StringUtils.IsNullOrEmpty(alias))
            {
                alias = GetTargetEntity().GetName();
            }
            string alias2 = alias;

            Net.Vpc.Upa.Expressions.Expression filter2 = GetPersistenceUnit().GetExpressionManager().SimplifyExpression(filter.Copy(), v);
            filter2.Visit(new Net.Vpc.Upa.Impl.Uql.Util.ThatExpressionReplacer(alias2));
            return(filter2);
        }
Beispiel #6
0
 public static void ReplaceThisVar(Net.Vpc.Upa.Expressions.Expression expression, string newName, Net.Vpc.Upa.ExpressionManager expressionManager)
 {
     Net.Vpc.Upa.Expressions.ExpressionVisitor expressionVisitor = new Net.Vpc.Upa.Impl.Uql.Util.ThisRenamerVisitor(expressionManager, newName);
     expression.Visit(expressionVisitor);
 }