Package org.datanucleus.query.expression

Examples of org.datanucleus.query.expression.Expression.evaluate()


            compileComponent = CompilationComponent.GROUPING;
            Expression[] groupExprs = compilation.getExprGrouping();
            for (int i = 0; i < groupExprs.length; i++)
            {
                Expression groupExpr = groupExprs[i];
                SQLExpression sqlGroupExpr = (SQLExpression)groupExpr.evaluate(this);
                stmt.addGroupingExpression(sqlGroupExpr);
            }
            compileComponent = null;
        }
    }
View Full Code Here


        if (compilation.getExprHaving() != null)
        {
            // Apply any having to the statement
            compileComponent = CompilationComponent.HAVING;
            Expression havingExpr = compilation.getExprHaving();
            Object havingEval = havingExpr.evaluate(this);
            if (!(havingEval instanceof BooleanExpression))
            {
                // Non-boolean having clause should be user exception
                throw new NucleusUserException(LOCALISER.msg("021051", havingExpr));
            }
View Full Code Here

            ArrayExpression arrExpr = (ArrayExpression)invokedExpr;
            SQLExpression[] arrSqlExprs = new SQLExpression[arrExpr.getArraySize()];
            for (int i=0;i<arrExpr.getArraySize();i++)
            {
                Expression arrElemExpr = arrExpr.getElement(i);
                arrElemExpr.evaluate(this);
                arrSqlExprs[i] = stack.pop();
            }
            JavaTypeMapping m = exprFactory.getMappingForType(Object[].class, false);
            invokedSqlExpr =
                new org.datanucleus.store.rdbms.sql.expression.ArrayExpression(stmt, m, arrSqlExprs);
View Full Code Here

                    sqlExprArgs.add(stack.pop());
                }
                else if (argExpr instanceof DyadicExpression)
                {
                    // Evaluate using this evaluator
                    argExpr.evaluate(this);
                    sqlExprArgs.add(stack.pop());
                }
                else if (argExpr instanceof VariableExpression)
                {
                    processVariableExpression((VariableExpression)argExpr);
View Full Code Here

        int i = 0;
        while (whenExprIter.hasNext())
        {
            Map.Entry<Expression, Expression> entry = whenExprIter.next();
            Expression whenExpr = entry.getKey();
            whenExpr.evaluate(this);
            whenSqlExprs[i] = stack.pop();

            Expression actionExpr = entry.getValue();
            actionExpr.evaluate(this);
            actionSqlExprs[i] = stack.pop();
View Full Code Here

            Expression whenExpr = entry.getKey();
            whenExpr.evaluate(this);
            whenSqlExprs[i] = stack.pop();

            Expression actionExpr = entry.getValue();
            actionExpr.evaluate(this);
            actionSqlExprs[i] = stack.pop();

            i++;
        }
View Full Code Here

            i++;
        }

        Expression elseExpr = expr.getElseExpression();
        elseExpr.evaluate(this);
        SQLExpression elseSqlExpr = stack.pop();

        SQLExpression caseSqlExpr = new org.datanucleus.store.rdbms.sql.expression.CaseExpression(
            whenSqlExprs, actionSqlExprs, elseSqlExpr);
        stack.push(caseSqlExpr);
View Full Code Here

    private boolean satisfiesHavingClause(List set)
    {
        state.put(RESULTS_SET, set);

        Expression having = compilation.getExprHaving();
        if (having.evaluate(evaluator) == Boolean.TRUE)
        {
            return true;
        }
        return false;
    }
View Full Code Here

            if (!state.containsKey(candidateAlias))
            {
                throw new NucleusUserException("Alias \"" + candidateAlias + "\" doesn't exist in the query or the candidate alias wasn't defined");
            }
            state.put(candidateAlias, obj);
            if (filter.evaluate(
                new InMemoryExpressionEvaluator(query.getObjectManager().getOMFContext().getQueryManager(),
                    parameterValues, state, query.getParsedImports(), clr, candidateAlias)) == Boolean.TRUE)
            {
                result.add(obj);
            }
View Full Code Here

    private boolean satisfiesHavingClause(List set)
    {
        state.put(RESULTS_SET, set);

        Expression having = compilation.getExprHaving();
        if (having.evaluate(evaluator) == Boolean.TRUE)
        {
            return true;
        }
        return false;
    }
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.