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

            return (NumericExpression) m.newLiteral(expr.getQueryExpression(), value);
        }
        ArrayList args = new ArrayList();
        args.add(expr);

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

        List args = new ArrayList();
        args.add(text);
        args.add(pattern);

        return new NumericExpression("JPOX_MATCHES",args).eq(integerLiteral);
    }
View Full Code Here

        if (from != null)
        {
            // TODO Find a function in Postgresql that supports the "from" position for searching
            throw new JPOXUserException("PostgreSQL doesnt currently provide a function for providing indexOf(str, from). Your workaround is to miss off the 'from' position");
        }
        NumericExpression locateExpr = new NumericExpression("STRPOS", args);

        // Subtract 1 from the result of STRPOS 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

        ScalarExpression submethodLiteral = m.newLiteral(date.getQueryExpression(), "day");
        args.add(submethodLiteral);

        args.add(date);

        return new NumericExpression("date_part", 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 m2 = getMapping(BigInteger.class, date);
        ScalarExpression integerLiteral = m2.newLiteral(date.getQueryExpression(), BigInteger.ONE);
        NumericExpression expr = new NumericExpression(new NumericExpression("date_part", args), ScalarExpression.OP_SUB, integerLiteral);
        expr.encloseWithInParentheses();
        return expr;
    }
View Full Code Here

        ScalarExpression submethodLiteral = m.newLiteral(date.getQueryExpression(), "year");
        args.add(submethodLiteral);

        args.add(date);

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

        ScalarExpression submethodLiteral = m.newLiteral(time.getQueryExpression(), "hour");
        args.add(submethodLiteral);

        args.add(time);

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

        ScalarExpression submethodLiteral = m.newLiteral(time.getQueryExpression(), "minute");
        args.add(submethodLiteral);

        args.add(time);

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