Package org.jpox.store.mapped.expression

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


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

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


    public NumericExpression modOperator(ScalarExpression operand1, ScalarExpression operand2)
    {
        ArrayList args = new ArrayList();
        args.add(operand1);
        args.add(operand2);
        return new NumericExpression("MOD", args);
    }
View Full Code Here

        args.add(getMapping(String.class, date).newLiteral(date.getQueryExpression(), "DD"));

        ArrayList args1 = new ArrayList();
        args1.add(new StringExpression("TO_CHAR", args));

        return new NumericExpression("TO_NUMBER", args1);
    }
View Full Code Here

        args1.add(new StringExpression("TO_CHAR", args));

        // 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("TO_NUMBER", args1), ScalarExpression.OP_SUB, integerLiteral);

        expr.encloseWithInParentheses();
        return expr;
    }
View Full Code Here

        args.add(getMapping(String.class, date).newLiteral(date.getQueryExpression(), "YYYY"));

        ArrayList args1 = new ArrayList();
        args1.add(new StringExpression("TO_CHAR", args));

        return new NumericExpression("TO_NUMBER", args1);
    }
View Full Code Here

        args.add(getMapping(String.class, time).newLiteral(time.getQueryExpression(), "HH24"));

        ArrayList args1 = new ArrayList();
        args1.add(new StringExpression("TO_CHAR", args));

        return new NumericExpression("TO_NUMBER", args1);
    }
View Full Code Here

        args.add(getMapping(String.class, time).newLiteral(time.getQueryExpression(), "MI"));

        ArrayList args1 = new ArrayList();
        args1.add(new StringExpression("TO_CHAR", args));

        return new NumericExpression("TO_NUMBER", args1);
    }
View Full Code Here

        args.add(getMapping(String.class, time).newLiteral(time.getQueryExpression(), "SS"));

        ArrayList args1 = new ArrayList();
        args1.add(new StringExpression("TO_CHAR", args));

        return new NumericExpression("TO_NUMBER", args1);
    }
View Full Code Here

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

        // Subtract 1 from the result of INSTR 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 lengthMethod(StringExpression str)
    {
        ArrayList args = new ArrayList();
        args.add(str);

        return new NumericExpression("LENGTH", 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.