Package org.jpox.store.mapped.expression

Examples of org.jpox.store.mapped.expression.NumericExpression


    public NumericExpression expMethod(ScalarExpression expr)
    {
        ArrayList args = new ArrayList();
        args.add(expr);

        return new NumericExpression("EXP", args);
    }
View Full Code Here


    public NumericExpression logMethod(ScalarExpression expr)
    {
        ArrayList args = new ArrayList();
        args.add(expr);

        return new NumericExpression("LOG", args);
    }
View Full Code Here

    public NumericExpression floorMethod(ScalarExpression expr)
    {
        ArrayList args = new ArrayList();
        args.add(expr);

        return new NumericExpression("FLOOR", args);
    }
View Full Code Here

    public NumericExpression ceilMethod(ScalarExpression expr)
    {
        ArrayList args = new ArrayList();
        args.add(expr);

        return new NumericExpression("CEIL", args);
    }
View Full Code Here

    public NumericExpression lengthMethod(StringExpression str)
    {
        ArrayList args = new ArrayList();
        args.add(str);

        return new NumericExpression("CHAR_LENGTH", args);
    }
View Full Code Here

        if (from != null)
        {
            // Add 1 to the passed in value so that it is of origin 1 to be compatible with LOCATE
            args.add(from.add(integerLiteral));
        }
        NumericExpression locateExpr = new NumericExpression("LOCATE", args);

        // Subtract 1 from the result of LOCATE to be consistent with Java strings
        // TODO Would be nice to put this in parentheses
        return new NumericExpression(locateExpr, ScalarExpression.OP_SUB, integerLiteral);
    }
View Full Code Here

    public NumericExpression getDayMethod(SqlTemporalExpression date)
    {
        ArrayList args = new ArrayList();
        args.add(date);

        return new NumericExpression("DAY", args);
    }
View Full Code Here

        args.add(date);

        // Delete one from the SQL "month" (origin=1) to be compatible with Java month (origin=0)
        JavaTypeMapping m = getMapping(BigInteger.class, date);
        ScalarExpression integerLiteral = m.newLiteral(date.getQueryExpression(), BigInteger.ONE);
        NumericExpression expr = new NumericExpression(new NumericExpression("MONTH", args), ScalarExpression.OP_SUB, integerLiteral);
        expr.encloseWithInParentheses();
        return expr;
    }
View Full Code Here

    public NumericExpression getYearMethod(SqlTemporalExpression date)
    {
        ArrayList args = new ArrayList();
        args.add(date);

        return new NumericExpression("YEAR", args);
    }
View Full Code Here

    public NumericExpression getHourMethod(SqlTemporalExpression time)
    {
        ArrayList args = new ArrayList();
        args.add(time);

        return new NumericExpression("HOUR", args);
    }
View Full Code Here

TOP

Related Classes of org.jpox.store.mapped.expression.NumericExpression

Copyright © 2018 www.massapicom. 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.