Examples of NumericExpression


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

        ArrayList funcArgs = new ArrayList();
        funcArgs.add(mm);
        funcArgs.add(expr);

        // Delete one from the SQL "month" (origin=1) to be compatible with Java month (origin=0)
        NumericExpression numExpr = new NumericExpression(
            new NumericExpression(stmt, getMappingForClass(int.class), "date_part", funcArgs),
            Expression.OP_SUB, one);
        numExpr.encloseInParentheses();
        return numExpr;
    }
View Full Code Here

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

        ArrayList funcArgs = new ArrayList();
        funcArgs.add(expr);
        funcArgs.add(mi);
        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

        List funcArgs = new ArrayList();
        funcArgs.add(expr);
        funcArgs.add(argExpr);
        JavaTypeMapping m = exprFactory.getMappingForType(BigInteger.class, false);
        SQLExpression one = ExpressionUtils.getLiteralForOne(stmt);
        return new NumericExpression(stmt, m, "NUCLEUS_MATCHES", funcArgs).eq(one);
    }
View Full Code Here

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

                }
                types = new ArrayList();
                types.add("BIGINT");

                List funcArgs3 = new ArrayList();
                funcArgs3.add(new NumericExpression(fromExpr, Expression.OP_ADD, one));

                // Add 1 to the passed in value so that it is of origin 1 to be compatible with LOCATE
                // Make sure argument is typed as BIGINT
                funcArgs.add(new NumericExpression(stmt, getMappingForClass(int.class), "CAST", funcArgs3, types));
            }
            NumericExpression locateExpr = new NumericExpression(stmt, getMappingForClass(int.class), "LOCATE", funcArgs);

            // Subtract 1 from the result of LOCATE to be consistent with Java strings
            return new NumericExpression(locateExpr, Expression.OP_SUB, one).encloseInParentheses();
        }
    }
View Full Code Here

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        ArrayList funcArgs = new ArrayList();
        funcArgs.add(hh);
        funcArgs.add(expr);
        return new NumericExpression(stmt, getMappingForClass(int.class), "date_part", 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.