Package org.datanucleus.store.rdbms.sql.expression

Examples of org.datanucleus.store.rdbms.sql.expression.NumericExpression


                {
                    throw new NucleusException(LOCALISER.msg("060003", "indexOf", "StringExpression", 1,
                        "NumericExpression"));
                }
                // Add 1 to the passed in value so that it is of origin 1 to be compatible with CHARINDEX
                funcArgs.add(new NumericExpression(fromExpr, Expression.OP_ADD, one));
            }

            // Subtract 1 from the result of CHARINDEX to be consistent with Java strings
            NumericExpression locateExpr = new NumericExpression(stmt, getMappingForClass(int.class), "CHARINDEX", funcArgs);
            return new NumericExpression(locateExpr, Expression.OP_SUB, one).encloseInParentheses();
        }
    }
View Full Code Here


        ArrayList funcArgs = new ArrayList();
        funcArgs.add(expr);
        funcArgs.add(dd);
        ArrayList funcArgs2 = new ArrayList();
        funcArgs2.add(new StringExpression(stmt, mapping, "TO_CHAR", funcArgs));
        return new NumericExpression(stmt, getMappingForClass(int.class), "TO_NUMBER", funcArgs2);
    }
View Full Code Here

        ArrayList funcArgs = new ArrayList();
        funcArgs.add(expr);
        funcArgs.add(hh);
        ArrayList funcArgs2 = new ArrayList();
        funcArgs2.add(new StringExpression(stmt, mapping, "TO_CHAR", funcArgs));
        return new NumericExpression(stmt, getMappingForClass(int.class), "TO_NUMBER", funcArgs2);
    }
View Full Code Here

        ArrayList funcArgs = new ArrayList();
        funcArgs.add(expr);
        funcArgs.add(yyyy);
        ArrayList funcArgs2 = new ArrayList();
        funcArgs2.add(new StringExpression(stmt, mapping, "TO_CHAR", funcArgs));
        return new NumericExpression(stmt, getMappingForClass(int.class), "TO_NUMBER", funcArgs2);
    }
View Full Code Here

            throw new NucleusException(LOCALISER.msg("060001", "getSecond()", expr));
        }

        ArrayList funcArgs = new ArrayList();
        funcArgs.add(expr);
        return new NumericExpression(stmt, getMappingForClass(int.class), "SECOND", funcArgs);
    }
View Full Code Here

                    "StringExpression/CharacterExpression/Parameter"));
            }

            if (args.size() == 2)
            {
                NumericExpression numExpr = (NumericExpression) args.get(1);
                funcArgs.add(substrExpr);
                funcArgs.add(expr);
                return new BooleanExpression(
                    new StringExpression(stmt, getMappingForClass(int.class), "CHARINDEX", funcArgs), Expression.OP_EQ,
                        one.add(numExpr));
View Full Code Here

        SQLExpression hh = exprFactory.newLiteral(stmt, mapping, "hh");

        ArrayList funcArgs = new ArrayList();
        funcArgs.add(hh);
        funcArgs.add(expr);
        return new NumericExpression(stmt, getMappingForClass(int.class), "DATEPART", funcArgs);
    }
View Full Code Here

        SQLExpression mi = exprFactory.newLiteral(stmt, mapping, "mi");

        ArrayList funcArgs = new ArrayList();
        funcArgs.add(mi);
        funcArgs.add(expr);
        return new NumericExpression(stmt, getMappingForClass(int.class), "DATEPART", funcArgs);
    }
View Full Code Here

        SQLExpression ss = exprFactory.newLiteral(stmt, mapping, "ss");

        ArrayList funcArgs = new ArrayList();
        funcArgs.add(ss);
        funcArgs.add(expr);
        return new NumericExpression(stmt, getMappingForClass(int.class), "DATEPART", funcArgs);
    }
View Full Code Here

        }
        else if (expr instanceof StringExpression || expr instanceof ParameterLiteral)
        {
            ArrayList funcArgs = new ArrayList();
            funcArgs.add(expr);
            return new NumericExpression(stmt, getMappingForClass(int.class), "LENGTH", funcArgs);
        }
        else
        {
            throw new NucleusException(LOCALISER.msg("060001", "length", expr));
        }
View Full Code Here

TOP

Related Classes of org.datanucleus.store.rdbms.sql.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.