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

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


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

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

                {
                    cls = Long.class;
                    clsLevel = 1;
                }
            }
            return new NumericExpression(stmt, getMappingForClass(cls), "COALESCE", args);
        }
        else
        {
            throw new NucleusException(LOCALISER.msg("060002", "COALESCE", expr));
        }
View Full Code Here

                orderTable = elemSqlExpr.getSQLTable();
                orderMapping = ((ClassTable)elemSqlExpr.getSQLTable().getTable()).getExternalMapping(mmd,
                    MappingConsumer.MAPPING_TYPE_EXTERNAL_INDEX);
            }

            return new NumericExpression(stmt, orderTable, orderMapping);
        }
        else
        {
            throw new NucleusException(LOCALISER.msg("060002", "INDEX", ignore));
        }
View Full Code Here

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

        ArrayList funcArgs = new ArrayList();
        funcArgs.add(day);
        funcArgs.add(expr);
        return new NumericExpression(stmt, getMappingForClass(int.class), "date_part", 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), "CHAR_LENGTH", funcArgs);
        }
        else
        {
            throw new NucleusException(LOCALISER.msg("060001", "length", expr));
        }
View Full Code Here

        funcArgs.add(mm);
        ArrayList funcArgs2 = new ArrayList();
        funcArgs2.add(new StringExpression(stmt, getMappingForClass(int.class), "TO_CHAR", funcArgs));

        // 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), "TO_NUMBER", funcArgs2),
            Expression.OP_SUB, one);
        numExpr.encloseInParentheses();
        return numExpr;
    }
View Full Code Here

                    throw new NucleusException(LOCALISER.msg("060003", "indexOf", "StringExpression", 1,
                        "NumericExpression"));
                }
                funcArgs.add(fromExpr.add(one));
            }
            NumericExpression locateExpr = new NumericExpression(stmt, getMappingForClass(int.class), "INSTR", funcArgs);
            return new NumericExpression(locateExpr, Expression.OP_SUB, one).encloseInParentheses();
        }
    }
View Full Code Here

                    throw new NucleusException(LOCALISER.msg("060003", "indexOf", "StringExpression", 1,
                        "NumericExpression"));
                }
                funcArgs.add(fromExpr.add(one));
            }
            NumericExpression locateExpr = new NumericExpression(stmt, getMappingForClass(int.class), "LOCATE", funcArgs);
            return new NumericExpression(locateExpr, Expression.OP_SUB, one).encloseInParentheses();
        }
    }
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.