Package ch.epfl.labos.iu.orm.queryll2.symbolic

Examples of ch.epfl.labos.iu.orm.queryll2.symbolic.TypedValue.visit()


{
   public static TypedValue simplify(TypedValue value, Map<MethodSignature, TypedValue.ComparisonValue.ComparisonOp> comparisonMethods)
   {
      TypedValue simplifiedBooleanReturnValue = value
            .visit(new TypedValueRewriterWalker<Object, RuntimeException>(new SymbExSimplifier<Object>(comparisonMethods)), null);
      simplifiedBooleanReturnValue = simplifiedBooleanReturnValue.visit(new SymbExBooleanRewriter(), false);
      return simplifiedBooleanReturnValue;
//      return value.visit(new TypedValueRewriterWalker<Object, RuntimeException>(new SymbExSimplifier<Object>(comparisonMethods)), null);
   }
//   public TypedValue getIsTrueReturnValue()
//   {
View Full Code Here


//   }
   public static TypedValue simplifyBoolean(TypedValue value, Map<MethodSignature, TypedValue.ComparisonValue.ComparisonOp> comparisonMethods)
   {
      TypedValue simplifiedBooleanReturnValue = value
            .visit(new TypedValueRewriterWalker<Object, RuntimeException>(new SymbExSimplifier<Object>(comparisonMethods)), null);
      simplifiedBooleanReturnValue = simplifiedBooleanReturnValue.visit(new SymbExBooleanRewriter(), true);
      return simplifiedBooleanReturnValue;
   }
//   public TypedValue getSimplifiedIsTrueReturnValue()
//   {
//      if (simplifiedIsTrueReturnValue == null)
View Full Code Here

   {
      List<TypedValue> newConditions = new ArrayList<TypedValue>();
      for (TypedValue cond: conditions)
      {
         TypedValue simpcond = cond.visit(new TypedValueRewriterWalker<Object, RuntimeException>(new SymbExSimplifier<Object>(comparisonMethods)), null);
         simpcond = simpcond.visit(new SymbExBooleanRewriter(), true);
         newConditions.add(simpcond);
      }
      return newConditions;
   }
  
View Full Code Here

         PathAnalysis path = where.symbolicAnalysis.paths.get(n);

         TypedValue returnVal = PathAnalysisSimplifier
               .simplifyBoolean(path.getReturnValue(), config.getComparisonMethods());
         SymbExPassDown returnPassdown = SymbExPassDown.with(null, true);
         ColumnExpressions<?> returnColumns = returnVal.visit(translator, returnPassdown);
         if (!returnColumns.isSingleColumn())
            throw new QueryTransformException("Expecting single column");
         Expression returnExpr = returnColumns.getOnlyColumn();

         if (returnVal instanceof ConstantValue.BooleanConstant)
View Full Code Here

      TypedValue operandVal;
      if (leftVal instanceof ConstantValue.NullConstant)
         operandVal = rightVal;
      else
         operandVal = leftVal;
      ColumnExpressions<U> operand = (ColumnExpressions<U>)operandVal.visit(this, passdown);
      if ("=".equals(opString))
         return ColumnExpressions.singleColumn(new SimpleRowReader<>(),
               UnaryExpression.postfix("IS NULL", operand.getOnlyColumn()));
      else
         return ColumnExpressions.singleColumn(new SimpleRowReader<>(),
View Full Code Here

         {
            SymbExPassDown passdown = SymbExPassDown.with(val, in.isExpectingConditional);
            TypedValue baseVal = val.args.get(0);
            if (isWideningCast(baseVal))
               baseVal = skipWideningCast(baseVal);
            ColumnExpressions<?> base = baseVal.visit(this, passdown);
            return ColumnExpressions.singleColumn(new SimpleRowReader<>(),
                  FunctionExpression.singleParam("SQRT", base.getOnlyColumn()));
         }
         throw new TypedValueVisitorException("Do not know how to translate the method " + sig + " into a JPQL function");
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.