Examples of NumericExpression


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

    public SQLExpression getExpression(SQLExpression expr, List args)
    {
        if (expr == null)
        {
            // Assume that we have something like "ABS({expr})"
            return new NumericExpression(stmt, getMappingForClass(getClassForMapping()), getFunctionName(), args);
        }
        else
        {
            throw new NucleusException(LOCALISER.msg("060002", getFunctionName(), expr));
        }
View Full Code Here

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

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

        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

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

        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

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

        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

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

            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

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

                    "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

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

        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

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

        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

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

        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
TOP
Copyright © 2018 www.massapi.com. 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.