Package org.jpox.store.mapped.expression

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


        args.add(leftOperand);
        args.add(rightOperand);
        ScalarExpression literal = getMapping(BigInteger.class, leftOperand).newLiteral(leftOperand.getQueryExpression(), BigInteger.ZERO);
        args.add(literal);
        //JPOX_STRPOS( SearchString, stringSearched, [StartPosition] )
        return new BooleanExpression(new StringExpression("JPOX_STRPOS", args),ScalarExpression.OP_EQ,lengthMethod((StringExpression)leftOperand).sub(lengthMethod((StringExpression)rightOperand)).add(integerLiteral).encloseWithInParentheses());
    }
View Full Code Here


    {
        ArrayList args = new ArrayList();
        args.add(str);
        args.add(begin.add(getMapping(BigInteger.class, str).newLiteral(str.getQueryExpression(), BigInteger.ONE)));

        return new StringExpression("SUBSTR", args);
    }
View Full Code Here

        ArrayList args = new ArrayList();
        args.add(str);
        args.add(begin.add(getMapping(BigInteger.class, str).newLiteral(str.getQueryExpression(), BigInteger.ONE)));
        args.add(end.sub(begin));

        return new StringExpression("SUBSTR", args);
    }
View Full Code Here

        ArrayList args = new ArrayList();
        args.add(date);
        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

        ArrayList args = new ArrayList();
        args.add(date);
        args.add(getMapping(String.class, date).newLiteral(date.getQueryExpression(), "MM"));

        ArrayList args1 = new ArrayList();
        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);
View Full Code Here

        ArrayList args = new ArrayList();
        args.add(date);
        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

        ArrayList args = new ArrayList();
        args.add(time);
        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

        ArrayList args = new ArrayList();
        args.add(time);
        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

        ArrayList args = new ArrayList();
        args.add(time);
        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

        ArrayList args = new ArrayList();
        args.add(str);
        args.add(begin.add(getMapping(Integer.class, str).newLiteral(str.getQueryExpression(), BigInteger.ONE)));
        args.add(lengthMethod(str).sub(begin));

        return new StringExpression("SUBSTRING", args);
    }
View Full Code Here

TOP

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

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.