Package org.hibernate.dialect.function

Examples of org.hibernate.dialect.function.StandardSQLFunction


    registerColumnType( Types.VARBINARY, "varbinary($l)" );
    registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
    registerColumnType( Types.BLOB, "image" );
    registerColumnType( Types.CLOB, "text" );

    registerFunction( "ascii", new StandardSQLFunction("ascii", Hibernate.INTEGER) );
    registerFunction( "char", new StandardSQLFunction("char", Hibernate.CHARACTER) );
    registerFunction( "len", new StandardSQLFunction("len", Hibernate.LONG) );
    registerFunction( "lower", new StandardSQLFunction("lower") );
    registerFunction( "upper", new StandardSQLFunction("upper") );
    registerFunction( "str", new StandardSQLFunction("str", Hibernate.STRING) );
    registerFunction( "ltrim", new StandardSQLFunction("ltrim") );
    registerFunction( "rtrim", new StandardSQLFunction("rtrim") );
    registerFunction( "reverse", new StandardSQLFunction("reverse") );
    registerFunction( "space", new StandardSQLFunction("space", Hibernate.STRING) );

    registerFunction( "user", new NoArgSQLFunction("user", Hibernate.STRING) );

    registerFunction( "current_timestamp", new NoArgSQLFunction("getdate", Hibernate.TIMESTAMP) );
    registerFunction( "current_time", new NoArgSQLFunction("getdate", Hibernate.TIME) );
    registerFunction( "current_date", new NoArgSQLFunction("getdate", Hibernate.DATE) );

    registerFunction( "getdate", new NoArgSQLFunction("getdate", Hibernate.TIMESTAMP) );
    registerFunction( "getutcdate", new NoArgSQLFunction("getutcdate", Hibernate.TIMESTAMP) );
    registerFunction( "day", new StandardSQLFunction("day", Hibernate.INTEGER) );
    registerFunction( "month", new StandardSQLFunction("month", Hibernate.INTEGER) );
    registerFunction( "year", new StandardSQLFunction("year", Hibernate.INTEGER) );
    registerFunction( "datename", new StandardSQLFunction("datename", Hibernate.STRING) );

    registerFunction( "abs", new StandardSQLFunction("abs") );
    registerFunction( "sign", new StandardSQLFunction("sign", Hibernate.INTEGER) );

    registerFunction( "acos", new StandardSQLFunction("acos", Hibernate.DOUBLE) );
    registerFunction( "asin", new StandardSQLFunction("asin", Hibernate.DOUBLE) );
    registerFunction( "atan", new StandardSQLFunction("atan", Hibernate.DOUBLE) );
    registerFunction( "cos", new StandardSQLFunction("cos", Hibernate.DOUBLE) );
    registerFunction( "cot", new StandardSQLFunction("cot", Hibernate.DOUBLE) );
    registerFunction( "exp", new StandardSQLFunction("exp", Hibernate.DOUBLE) );
    registerFunction( "log", new StandardSQLFunction( "log", Hibernate.DOUBLE) );
    registerFunction( "log10", new StandardSQLFunction("log10", Hibernate.DOUBLE) );
    registerFunction( "sin", new StandardSQLFunction("sin", Hibernate.DOUBLE) );
    registerFunction( "sqrt", new StandardSQLFunction("sqrt", Hibernate.DOUBLE) );
    registerFunction( "tan", new StandardSQLFunction("tan", Hibernate.DOUBLE) );
    registerFunction( "pi", new NoArgSQLFunction("pi", Hibernate.DOUBLE) );
    registerFunction( "square", new StandardSQLFunction("square") );
    registerFunction( "rand", new StandardSQLFunction("rand", Hibernate.FLOAT) );

    registerFunction("radians", new StandardSQLFunction("radians", Hibernate.DOUBLE) );
    registerFunction("degrees", new StandardSQLFunction("degrees", Hibernate.DOUBLE) );

    registerFunction( "round", new StandardSQLFunction("round") );
    registerFunction( "ceiling", new StandardSQLFunction("ceiling") );
    registerFunction( "floor", new StandardSQLFunction("floor") );

    registerFunction( "isnull", new StandardSQLFunction("isnull") );

    registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "(","+",")" ) );

    registerFunction( "length", new StandardSQLFunction( "len", Hibernate.INTEGER ) );
    registerFunction( "trim", new SQLFunctionTemplate( Hibernate.STRING, "ltrim(rtrim(?1))") );
    registerFunction( "locate", new CharIndexFunction() );

    getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH);
  }
View Full Code Here


         * characteristics. If StandardSQLFunction(...) is used, the RDMS BIF
         * name and the return type (if any) is specified.  If
         * SQLFunctionTemplate(...) is used, the return type and a template
         * string is provided, plus an optional hasParenthesesIfNoArgs flag.
         */
    registerFunction( "abs", new StandardSQLFunction("abs") );
    registerFunction( "sign", new StandardSQLFunction("sign", Hibernate.INTEGER) );

    registerFunction("ascii", new StandardSQLFunction("ascii", Hibernate.INTEGER) );
    registerFunction("char_length", new StandardSQLFunction("char_length", Hibernate.INTEGER) );
    registerFunction("character_length", new StandardSQLFunction("character_length", Hibernate.INTEGER) );
    registerFunction("length", new StandardSQLFunction("length", Hibernate.INTEGER) );

    // The RDMS concat() function only supports 2 parameters
    registerFunction( "concat", new SQLFunctionTemplate(Hibernate.STRING, "concat(?1, ?2)") );
    registerFunction( "instr", new StandardSQLFunction("instr", Hibernate.STRING) );
    registerFunction( "lpad", new StandardSQLFunction("lpad", Hibernate.STRING) );
    registerFunction( "replace", new StandardSQLFunction("replace", Hibernate.STRING) );
    registerFunction( "rpad", new StandardSQLFunction("rpad", Hibernate.STRING) );
    registerFunction( "substr", new StandardSQLFunction("substr", Hibernate.STRING) );

    registerFunction("lcase", new StandardSQLFunction("lcase") );
    registerFunction("lower", new StandardSQLFunction("lower") );
    registerFunction("ltrim", new StandardSQLFunction("ltrim") );
    registerFunction("reverse", new StandardSQLFunction("reverse") );
    registerFunction("rtrim", new StandardSQLFunction("rtrim") );

    // RDMS does not directly support the trim() function, we use rtrim() and ltrim()
    registerFunction("trim", new SQLFunctionTemplate(Hibernate.INTEGER, "ltrim(rtrim(?1))" ) );
    registerFunction("soundex", new StandardSQLFunction("soundex") );
    registerFunction("space", new StandardSQLFunction("space", Hibernate.STRING) );
    registerFunction("ucase", new StandardSQLFunction("ucase") );
    registerFunction("upper", new StandardSQLFunction("upper") );

    registerFunction("acos", new StandardSQLFunction("acos", Hibernate.DOUBLE) );
    registerFunction("asin", new StandardSQLFunction("asin", Hibernate.DOUBLE) );
    registerFunction("atan", new StandardSQLFunction("atan", Hibernate.DOUBLE) );
    registerFunction("cos", new StandardSQLFunction("cos", Hibernate.DOUBLE) );
    registerFunction("cosh", new StandardSQLFunction("cosh", Hibernate.DOUBLE) );
    registerFunction("cot", new StandardSQLFunction("cot", Hibernate.DOUBLE) );
    registerFunction("exp", new StandardSQLFunction("exp", Hibernate.DOUBLE) );
    registerFunction("ln", new StandardSQLFunction("ln", Hibernate.DOUBLE) );
    registerFunction("log", new StandardSQLFunction("log", Hibernate.DOUBLE) );
    registerFunction("log10", new StandardSQLFunction("log10", Hibernate.DOUBLE) );
    registerFunction("pi", new NoArgSQLFunction("pi", Hibernate.DOUBLE) );
    registerFunction("rand", new NoArgSQLFunction("rand", Hibernate.DOUBLE) );
    registerFunction("sin", new StandardSQLFunction("sin", Hibernate.DOUBLE) );
    registerFunction("sinh", new StandardSQLFunction("sinh", Hibernate.DOUBLE) );
    registerFunction("sqrt", new StandardSQLFunction("sqrt", Hibernate.DOUBLE) );
    registerFunction("tan", new StandardSQLFunction("tan", Hibernate.DOUBLE) );
    registerFunction("tanh", new StandardSQLFunction("tanh", Hibernate.DOUBLE) );

    registerFunction( "round", new StandardSQLFunction("round") );
    registerFunction( "trunc", new StandardSQLFunction("trunc") );
    registerFunction( "ceil", new StandardSQLFunction("ceil") );
    registerFunction( "floor", new StandardSQLFunction("floor") );

    registerFunction( "chr", new StandardSQLFunction("chr", Hibernate.CHARACTER) );
    registerFunction( "initcap", new StandardSQLFunction("initcap") );

    registerFunction( "user", new NoArgSQLFunction("user", Hibernate.STRING, false) );

    registerFunction( "current_date", new NoArgSQLFunction("current_date", Hibernate.DATE, false) );
    registerFunction( "current_time", new NoArgSQLFunction("current_timestamp", Hibernate.TIME, false) );
    registerFunction( "current_timestamp", new NoArgSQLFunction("current_timestamp", Hibernate.TIMESTAMP, false) );
    registerFunction("curdate", new NoArgSQLFunction("curdate",Hibernate.DATE) );
    registerFunction("curtime", new NoArgSQLFunction("curtime",Hibernate.TIME) );
    registerFunction("days", new StandardSQLFunction("days",Hibernate.INTEGER) );
    registerFunction("dayofmonth", new StandardSQLFunction("dayofmonth",Hibernate.INTEGER) );
    registerFunction("dayname", new StandardSQLFunction("dayname",Hibernate.STRING) );
    registerFunction("dayofweek", new StandardSQLFunction("dayofweek",Hibernate.INTEGER) );
    registerFunction("dayofyear", new StandardSQLFunction("dayofyear",Hibernate.INTEGER) );
    registerFunction("hour", new StandardSQLFunction("hour",Hibernate.INTEGER) );
    registerFunction("last_day", new StandardSQLFunction("last_day",Hibernate.DATE) );
    registerFunction("microsecond", new StandardSQLFunction("microsecond",Hibernate.INTEGER) );
    registerFunction("minute", new StandardSQLFunction("minute",Hibernate.INTEGER) );
    registerFunction("month", new StandardSQLFunction("month",Hibernate.INTEGER) );
    registerFunction("monthname", new StandardSQLFunction("monthname",Hibernate.STRING) );
    registerFunction("now", new NoArgSQLFunction("now",Hibernate.TIMESTAMP) );
    registerFunction("quarter", new StandardSQLFunction("quarter",Hibernate.INTEGER) );
    registerFunction("second", new StandardSQLFunction("second",Hibernate.INTEGER) );
    registerFunction("time", new StandardSQLFunction("time",Hibernate.TIME) );
    registerFunction("timestamp", new StandardSQLFunction("timestamp",Hibernate.TIMESTAMP) );
    registerFunction("week", new StandardSQLFunction("week",Hibernate.INTEGER) );
    registerFunction("year", new StandardSQLFunction("year",Hibernate.INTEGER) );

    registerFunction("atan2", new StandardSQLFunction("atan2",Hibernate.DOUBLE) );
    registerFunction( "mod", new StandardSQLFunction("mod",Hibernate.INTEGER) );
    registerFunction( "nvl", new StandardSQLFunction("nvl") );
    registerFunction( "power", new StandardSQLFunction("power", Hibernate.DOUBLE) );

    /**
     * For a list of column types to register, see section A-1
     * in 7862 7395, the Unisys JDBC manual.
     *
 
View Full Code Here

    registerColumnType( Types.VARBINARY, 8000, "varbinary($l)" );

    registerFunction( "second", new SQLFunctionTemplate( Hibernate.INTEGER, "datepart(second, ?1)" ) );
    registerFunction( "minute", new SQLFunctionTemplate( Hibernate.INTEGER, "datepart(minute, ?1)" ) );
    registerFunction( "hour", new SQLFunctionTemplate( Hibernate.INTEGER, "datepart(hour, ?1)" ) );
    registerFunction( "locate", new StandardSQLFunction( "charindex", Hibernate.INTEGER ) );

    registerFunction( "extract", new SQLFunctionTemplate( Hibernate.INTEGER, "datepart(?1, ?3)" ) );
    registerFunction( "mod", new SQLFunctionTemplate( Hibernate.INTEGER, "?1 % ?2" ) );
    registerFunction( "bit_length", new SQLFunctionTemplate( Hibernate.INTEGER, "datalength(?1) * 8" ) );

View Full Code Here

    registerColumnType( Types.VARBINARY, "bytea" );
    registerColumnType( Types.CLOB, "text" );
    registerColumnType( Types.BLOB, "oid" );
    registerColumnType( Types.NUMERIC, "numeric($p, $s)" );

    registerFunction( "abs", new StandardSQLFunction("abs") );
    registerFunction( "sign", new StandardSQLFunction("sign", Hibernate.INTEGER) );

    registerFunction( "acos", new StandardSQLFunction("acos", Hibernate.DOUBLE) );
    registerFunction( "asin", new StandardSQLFunction("asin", Hibernate.DOUBLE) );
    registerFunction( "atan", new StandardSQLFunction("atan", Hibernate.DOUBLE) );
    registerFunction( "cos", new StandardSQLFunction("cos", Hibernate.DOUBLE) );
    registerFunction( "cot", new StandardSQLFunction("cot", Hibernate.DOUBLE) );
    registerFunction( "exp", new StandardSQLFunction("exp", Hibernate.DOUBLE) );
    registerFunction( "ln", new StandardSQLFunction("ln", Hibernate.DOUBLE) );
    registerFunction( "log", new StandardSQLFunction("log", Hibernate.DOUBLE) );
    registerFunction( "sin", new StandardSQLFunction("sin", Hibernate.DOUBLE) );
    registerFunction( "sqrt", new StandardSQLFunction("sqrt", Hibernate.DOUBLE) );
    registerFunction( "cbrt", new StandardSQLFunction("cbrt", Hibernate.DOUBLE) );
    registerFunction( "tan", new StandardSQLFunction("tan", Hibernate.DOUBLE) );
    registerFunction( "radians", new StandardSQLFunction("radians", Hibernate.DOUBLE) );
    registerFunction( "degrees", new StandardSQLFunction("degrees", Hibernate.DOUBLE) );

    registerFunction( "stddev", new StandardSQLFunction("stddev", Hibernate.DOUBLE) );
    registerFunction( "variance", new StandardSQLFunction("variance", Hibernate.DOUBLE) );

    registerFunction( "random", new NoArgSQLFunction("random", Hibernate.DOUBLE) );

    registerFunction( "round", new StandardSQLFunction("round") );
    registerFunction( "trunc", new StandardSQLFunction("trunc") );
    registerFunction( "ceil", new StandardSQLFunction("ceil") );
    registerFunction( "floor", new StandardSQLFunction("floor") );

    registerFunction( "chr", new StandardSQLFunction("chr", Hibernate.CHARACTER) );
    registerFunction( "lower", new StandardSQLFunction("lower") );
    registerFunction( "upper", new StandardSQLFunction("upper") );
    registerFunction( "substr", new StandardSQLFunction("substr", Hibernate.STRING) );
    registerFunction( "initcap", new StandardSQLFunction("initcap") );
    registerFunction( "to_ascii", new StandardSQLFunction("to_ascii") );
    registerFunction( "quote_ident", new StandardSQLFunction("quote_ident", Hibernate.STRING) );
    registerFunction( "quote_literal", new StandardSQLFunction("quote_literal", Hibernate.STRING) );
    registerFunction( "md5", new StandardSQLFunction("md5") );
    registerFunction( "ascii", new StandardSQLFunction("ascii", Hibernate.INTEGER) );
    registerFunction( "length", new StandardSQLFunction("length", Hibernate.LONG) );
    registerFunction( "char_length", new StandardSQLFunction("char_length", Hibernate.LONG) );
    registerFunction( "bit_length", new StandardSQLFunction("bit_length", Hibernate.LONG) );
    registerFunction( "octet_length", new StandardSQLFunction("octet_length", Hibernate.LONG) );

    registerFunction( "age", new StandardSQLFunction("age") );
    registerFunction( "current_date", new NoArgSQLFunction("current_date", Hibernate.DATE, false) );
    registerFunction( "current_time", new NoArgSQLFunction("current_time", Hibernate.TIME, false) );
    registerFunction( "current_timestamp", new NoArgSQLFunction("current_timestamp", Hibernate.TIMESTAMP, false) );
    registerFunction( "date_trunc", new StandardSQLFunction( "date_trunc", Hibernate.TIMESTAMP ) );
    registerFunction( "localtime", new NoArgSQLFunction("localtime", Hibernate.TIME, false) );
    registerFunction( "localtimestamp", new NoArgSQLFunction("localtimestamp", Hibernate.TIMESTAMP, false) );
    registerFunction( "now", new NoArgSQLFunction("now", Hibernate.TIMESTAMP) );
    registerFunction( "timeofday", new NoArgSQLFunction("timeofday", Hibernate.STRING) );

    registerFunction( "current_user", new NoArgSQLFunction("current_user", Hibernate.STRING, false) );
    registerFunction( "session_user", new NoArgSQLFunction("session_user", Hibernate.STRING, false) );
    registerFunction( "user", new NoArgSQLFunction("user", Hibernate.STRING, false) );
    registerFunction( "current_database", new NoArgSQLFunction("current_database", Hibernate.STRING, true) );
    registerFunction( "current_schema", new NoArgSQLFunction("current_schema", Hibernate.STRING, true) );
   
    registerFunction( "to_char", new StandardSQLFunction("to_char", Hibernate.STRING) );
    registerFunction( "to_date", new StandardSQLFunction("to_date", Hibernate.DATE) );
    registerFunction( "to_timestamp", new StandardSQLFunction("to_timestamp", Hibernate.TIMESTAMP) );
    registerFunction( "to_number", new StandardSQLFunction("to_number", Hibernate.BIG_DECIMAL) );

    registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "(","||",")" ) );

    registerFunction( "locate", new PositionSubstringFunction() );
View Full Code Here

    getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE );
    //getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH);

    getDefaultProperties().setProperty( Environment.USE_SQL_COMMENTS, "false" );

    registerFunction( "abs", new StandardSQLFunction( "abs" ) );
    registerFunction( "acos", new StandardJDBCEscapeFunction( "acos", Hibernate.DOUBLE ) );
    registerFunction( "%alphaup", new StandardSQLFunction( "%alphaup", Hibernate.STRING ) );
    registerFunction( "ascii", new StandardSQLFunction( "ascii", Hibernate.STRING ) );
    registerFunction( "asin", new StandardJDBCEscapeFunction( "asin", Hibernate.DOUBLE ) );
    registerFunction( "atan", new StandardJDBCEscapeFunction( "atan", Hibernate.DOUBLE ) );
    registerFunction( "bit_length", new SQLFunctionTemplate( Hibernate.INTEGER, "($length(?1)*8)" ) );
    // hibernate impelemnts cast in Dialect.java
    registerFunction( "ceiling", new StandardSQLFunction( "ceiling", Hibernate.INTEGER ) );
    registerFunction( "char", new StandardJDBCEscapeFunction( "char", Hibernate.CHARACTER ) );
    registerFunction( "character_length", new StandardSQLFunction( "character_length", Hibernate.INTEGER ) );
    registerFunction( "char_length", new StandardSQLFunction( "char_length", Hibernate.INTEGER ) );
    registerFunction( "cos", new StandardJDBCEscapeFunction( "cos", Hibernate.DOUBLE ) );
    registerFunction( "cot", new StandardJDBCEscapeFunction( "cot", Hibernate.DOUBLE ) );
    registerFunction( "coalesce", new VarArgsSQLFunction( "coalesce(", ",", ")" ) );
    registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "", "||", "" ) );
    registerFunction( "convert", new ConvertFunction() );
    registerFunction( "curdate", new StandardJDBCEscapeFunction( "curdate", Hibernate.DATE ) );
    registerFunction( "current_date", new NoArgSQLFunction( "current_date", Hibernate.DATE, false ) );
    registerFunction( "current_time", new NoArgSQLFunction( "current_time", Hibernate.TIME, false ) );
    registerFunction(
        "current_timestamp", new ConditionalParenthesisFunction( "current_timestamp", Hibernate.TIMESTAMP )
    );
    registerFunction( "curtime", new StandardJDBCEscapeFunction( "curtime", Hibernate.TIME ) );
    registerFunction( "database", new StandardJDBCEscapeFunction( "database", Hibernate.STRING ) );
    registerFunction( "dateadd", new VarArgsSQLFunction( Hibernate.TIMESTAMP, "dateadd(", ",", ")" ) );
    registerFunction( "datediff", new VarArgsSQLFunction( Hibernate.INTEGER, "datediff(", ",", ")" ) );
    registerFunction( "datename", new VarArgsSQLFunction( Hibernate.STRING, "datename(", ",", ")" ) );
    registerFunction( "datepart", new VarArgsSQLFunction( Hibernate.INTEGER, "datepart(", ",", ")" ) );
    registerFunction( "day", new StandardSQLFunction( "day", Hibernate.INTEGER ) );
    registerFunction( "dayname", new StandardJDBCEscapeFunction( "dayname", Hibernate.STRING ) );
    registerFunction( "dayofmonth", new StandardJDBCEscapeFunction( "dayofmonth", Hibernate.INTEGER ) );
    registerFunction( "dayofweek", new StandardJDBCEscapeFunction( "dayofweek", Hibernate.INTEGER ) );
    registerFunction( "dayofyear", new StandardJDBCEscapeFunction( "dayofyear", Hibernate.INTEGER ) );
    // is it necessary to register %exact since it can only appear in a where clause?
    registerFunction( "%exact", new StandardSQLFunction( "%exact", Hibernate.STRING ) );
    registerFunction( "exp", new StandardJDBCEscapeFunction( "exp", Hibernate.DOUBLE ) );
    registerFunction( "%external", new StandardSQLFunction( "%external", Hibernate.STRING ) );
    registerFunction( "$extract", new VarArgsSQLFunction( Hibernate.INTEGER, "$extract(", ",", ")" ) );
    registerFunction( "$find", new VarArgsSQLFunction( Hibernate.INTEGER, "$find(", ",", ")" ) );
    registerFunction( "floor", new StandardSQLFunction( "floor", Hibernate.INTEGER ) );
    registerFunction( "getdate", new StandardSQLFunction( "getdate", Hibernate.TIMESTAMP ) );
    registerFunction( "hour", new StandardJDBCEscapeFunction( "hour", Hibernate.INTEGER ) );
    registerFunction( "ifnull", new VarArgsSQLFunction( "ifnull(", ",", ")" ) );
    registerFunction( "%internal", new StandardSQLFunction( "%internal" ) );
    registerFunction( "isnull", new VarArgsSQLFunction( "isnull(", ",", ")" ) );
    registerFunction( "isnumeric", new StandardSQLFunction( "isnumeric", Hibernate.INTEGER ) );
    registerFunction( "lcase", new StandardJDBCEscapeFunction( "lcase", Hibernate.STRING ) );
    registerFunction( "left", new StandardJDBCEscapeFunction( "left", Hibernate.STRING ) );
    registerFunction( "len", new StandardSQLFunction( "len", Hibernate.INTEGER ) );
    registerFunction( "length", new StandardSQLFunction( "length", Hibernate.INTEGER ) );
    registerFunction( "$length", new VarArgsSQLFunction( "$length(", ",", ")" ) );
    // aggregate functions shouldn't be registered, right?
    //registerFunction( "list", new StandardSQLFunction("list",Hibernate.STRING) );
    // stopped on $list
    registerFunction( "$list", new VarArgsSQLFunction( "$list(", ",", ")" ) );
    registerFunction( "$listdata", new VarArgsSQLFunction( "$listdata(", ",", ")" ) );
    registerFunction( "$listfind", new VarArgsSQLFunction( "$listfind(", ",", ")" ) );
    registerFunction( "$listget", new VarArgsSQLFunction( "$listget(", ",", ")" ) );
    registerFunction( "$listlength", new StandardSQLFunction( "$listlength", Hibernate.INTEGER ) );
    registerFunction( "locate", new StandardSQLFunction( "$FIND", Hibernate.INTEGER ) );
    registerFunction( "log", new StandardJDBCEscapeFunction( "log", Hibernate.DOUBLE ) );
    registerFunction( "log10", new StandardJDBCEscapeFunction( "log", Hibernate.DOUBLE ) );
    registerFunction( "lower", new StandardSQLFunction( "lower" ) );
    registerFunction( "ltrim", new StandardSQLFunction( "ltrim" ) );
    registerFunction( "minute", new StandardJDBCEscapeFunction( "minute", Hibernate.INTEGER ) );
    registerFunction( "mod", new StandardJDBCEscapeFunction( "mod", Hibernate.DOUBLE ) );
    registerFunction( "month", new StandardJDBCEscapeFunction( "month", Hibernate.INTEGER ) );
    registerFunction( "monthname", new StandardJDBCEscapeFunction( "monthname", Hibernate.STRING ) );
    registerFunction( "now", new StandardJDBCEscapeFunction( "monthname", Hibernate.TIMESTAMP ) );
    registerFunction( "nullif", new VarArgsSQLFunction( "nullif(", ",", ")" ) );
    registerFunction( "nvl", new NvlFunction() );
    registerFunction( "%odbcin", new StandardSQLFunction( "%odbcin" ) );
    registerFunction( "%odbcout", new StandardSQLFunction( "%odbcin" ) );
    registerFunction( "%pattern", new VarArgsSQLFunction( Hibernate.STRING, "", "%pattern", "" ) );
    registerFunction( "pi", new StandardJDBCEscapeFunction( "pi", Hibernate.DOUBLE ) );
    registerFunction( "$piece", new VarArgsSQLFunction( Hibernate.STRING, "$piece(", ",", ")" ) );
    registerFunction( "position", new VarArgsSQLFunction( Hibernate.INTEGER, "position(", " in ", ")" ) );
    registerFunction( "power", new VarArgsSQLFunction( Hibernate.STRING, "power(", ",", ")" ) );
    registerFunction( "quarter", new StandardJDBCEscapeFunction( "quarter", Hibernate.INTEGER ) );
    registerFunction( "repeat", new VarArgsSQLFunction( Hibernate.STRING, "repeat(", ",", ")" ) );
    registerFunction( "replicate", new VarArgsSQLFunction( Hibernate.STRING, "replicate(", ",", ")" ) );
    registerFunction( "right", new StandardJDBCEscapeFunction( "right", Hibernate.STRING ) );
    registerFunction( "round", new VarArgsSQLFunction( Hibernate.FLOAT, "round(", ",", ")" ) );
    registerFunction( "rtrim", new StandardSQLFunction( "rtrim", Hibernate.STRING ) );
    registerFunction( "second", new StandardJDBCEscapeFunction( "second", Hibernate.INTEGER ) );
    registerFunction( "sign", new StandardSQLFunction( "sign", Hibernate.INTEGER ) );
    registerFunction( "sin", new StandardJDBCEscapeFunction( "sin", Hibernate.DOUBLE ) );
    registerFunction( "space", new StandardSQLFunction( "space", Hibernate.STRING ) );
    registerFunction( "%sqlstring", new VarArgsSQLFunction( Hibernate.STRING, "%sqlstring(", ",", ")" ) );
    registerFunction( "%sqlupper", new VarArgsSQLFunction( Hibernate.STRING, "%sqlupper(", ",", ")" ) );
    registerFunction( "sqrt", new StandardJDBCEscapeFunction( "SQRT", Hibernate.DOUBLE ) );
    registerFunction( "%startswith", new VarArgsSQLFunction( Hibernate.STRING, "", "%startswith", "" ) );
    // below is for Cache' that don't have str in 2007.1 there is str and we register str directly
    registerFunction( "str", new SQLFunctionTemplate( Hibernate.STRING, "cast(?1 as char varying)" ) );
    registerFunction( "string", new VarArgsSQLFunction( Hibernate.STRING, "string(", ",", ")" ) );
    // note that %string is deprecated
    registerFunction( "%string", new VarArgsSQLFunction( Hibernate.STRING, "%string(", ",", ")" ) );
    registerFunction( "substr", new VarArgsSQLFunction( Hibernate.STRING, "substr(", ",", ")" ) );
    registerFunction( "substring", new VarArgsSQLFunction( Hibernate.STRING, "substring(", ",", ")" ) );
    registerFunction( "sysdate", new NoArgSQLFunction( "sysdate", Hibernate.TIMESTAMP, false ) );
    registerFunction( "tan", new StandardJDBCEscapeFunction( "tan", Hibernate.DOUBLE ) );
    registerFunction( "timestampadd", new StandardJDBCEscapeFunction( "timestampadd", Hibernate.DOUBLE ) );
    registerFunction( "timestampdiff", new StandardJDBCEscapeFunction( "timestampdiff", Hibernate.DOUBLE ) );
    registerFunction( "tochar", new VarArgsSQLFunction( Hibernate.STRING, "tochar(", ",", ")" ) );
    registerFunction( "to_char", new VarArgsSQLFunction( Hibernate.STRING, "to_char(", ",", ")" ) );
    registerFunction( "todate", new VarArgsSQLFunction( Hibernate.STRING, "todate(", ",", ")" ) );
    registerFunction( "to_date", new VarArgsSQLFunction( Hibernate.STRING, "todate(", ",", ")" ) );
    registerFunction( "tonumber", new StandardSQLFunction( "tonumber" ) );
    registerFunction( "to_number", new StandardSQLFunction( "tonumber" ) );
    // TRIM(end_keyword string-expression-1 FROM string-expression-2)
    // use Hibernate implementation "From" is one of the parameters they pass in position ?3
    //registerFunction( "trim", new SQLFunctionTemplate(Hibernate.STRING, "trim(?1 ?2 from ?3)") );
    registerFunction( "truncate", new StandardJDBCEscapeFunction( "truncate", Hibernate.STRING ) );
    registerFunction( "ucase", new StandardJDBCEscapeFunction( "ucase", Hibernate.STRING ) );
    registerFunction( "upper", new StandardSQLFunction( "upper" ) );
    // %upper is deprecated
    registerFunction( "%upper", new StandardSQLFunction( "%upper" ) );
    registerFunction( "user", new StandardJDBCEscapeFunction( "user", Hibernate.STRING ) );
    registerFunction( "week", new StandardJDBCEscapeFunction( "user", Hibernate.INTEGER ) );
    registerFunction( "xmlconcat", new VarArgsSQLFunction( Hibernate.STRING, "xmlconcat(", ",", ")" ) );
    registerFunction( "xmlelement", new VarArgsSQLFunction( Hibernate.STRING, "xmlelement(", ",", ")" ) );
    // xmlforest requires a new kind of function constructor
View Full Code Here

        registerColumnType( Types.BLOB, "VARBINARY(4000000)" );
        registerColumnType( Types.CLOB, "VARCHAR(4000000)" );
 
    getDefaultProperties().setProperty(Environment.USE_STREAMS_FOR_BINARY, "true");
    getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE);
    registerFunction( "lower", new StandardSQLFunction("lower") );
    registerFunction( "upper", new StandardSQLFunction("upper") );
    registerFunction( "rtrim", new StandardSQLFunction("rtrim") );
    registerFunction( "concat", new StandardSQLFunction("concat", Hibernate.STRING) );
    registerFunction( "mod", new StandardSQLFunction("mod") );
    registerFunction( "to_char", new StandardSQLFunction("to_char",Hibernate.STRING) );
    registerFunction( "to_date", new StandardSQLFunction("to_date",Hibernate.TIMESTAMP) );
    registerFunction( "sysdate", new NoArgSQLFunction("sysdate", Hibernate.TIMESTAMP, false) );
    registerFunction( "getdate", new NoArgSQLFunction("getdate", Hibernate.TIMESTAMP, false) );
    registerFunction( "nvl", new StandardSQLFunction("nvl") );

  }
View Full Code Here

    registerColumnType( Types.NUMERIC, "numeric" );
    //HSQL has no Blob/Clob support .... but just put these here for now!
    registerColumnType( Types.BLOB, "longvarbinary" );
    registerColumnType( Types.CLOB, "longvarchar" );

    registerFunction( "ascii", new StandardSQLFunction( "ascii", Hibernate.INTEGER ) );
    registerFunction( "char", new StandardSQLFunction( "char", Hibernate.CHARACTER ) );
    registerFunction( "length", new StandardSQLFunction( "length", Hibernate.LONG ) );
    registerFunction( "lower", new StandardSQLFunction( "lower" ) );
    registerFunction( "upper", new StandardSQLFunction( "upper" ) );
    registerFunction( "lcase", new StandardSQLFunction( "lcase" ) );
    registerFunction( "ucase", new StandardSQLFunction( "ucase" ) );
    registerFunction( "soundex", new StandardSQLFunction( "soundex", Hibernate.STRING ) );
    registerFunction( "ltrim", new StandardSQLFunction( "ltrim" ) );
    registerFunction( "rtrim", new StandardSQLFunction( "rtrim" ) );
    registerFunction( "reverse", new StandardSQLFunction( "reverse" ) );
    registerFunction( "space", new StandardSQLFunction( "space", Hibernate.STRING ) );
    registerFunction( "rawtohex", new StandardSQLFunction( "rawtohex" ) );
    registerFunction( "hextoraw", new StandardSQLFunction( "hextoraw" ) );

    registerFunction( "user", new NoArgSQLFunction( "user", Hibernate.STRING ) );
    registerFunction( "database", new NoArgSQLFunction( "database", Hibernate.STRING ) );

    registerFunction( "current_date", new NoArgSQLFunction( "current_date", Hibernate.DATE, false ) );
    registerFunction( "curdate", new NoArgSQLFunction( "curdate", Hibernate.DATE ) );
    registerFunction( "current_timestamp", new NoArgSQLFunction( "current_timestamp", Hibernate.TIMESTAMP, false ) );
    registerFunction( "now", new NoArgSQLFunction( "now", Hibernate.TIMESTAMP ) );
    registerFunction( "current_time", new NoArgSQLFunction( "current_time", Hibernate.TIME, false ) );
    registerFunction( "curtime", new NoArgSQLFunction( "curtime", Hibernate.TIME ) );
    registerFunction( "day", new StandardSQLFunction( "day", Hibernate.INTEGER ) );
    registerFunction( "dayofweek", new StandardSQLFunction( "dayofweek", Hibernate.INTEGER ) );
    registerFunction( "dayofyear", new StandardSQLFunction( "dayofyear", Hibernate.INTEGER ) );
    registerFunction( "dayofmonth", new StandardSQLFunction( "dayofmonth", Hibernate.INTEGER ) );
    registerFunction( "month", new StandardSQLFunction( "month", Hibernate.INTEGER ) );
    registerFunction( "year", new StandardSQLFunction( "year", Hibernate.INTEGER ) );
    registerFunction( "week", new StandardSQLFunction( "week", Hibernate.INTEGER ) );
    registerFunction( "quater", new StandardSQLFunction( "quater", Hibernate.INTEGER ) );
    registerFunction( "hour", new StandardSQLFunction( "hour", Hibernate.INTEGER ) );
    registerFunction( "minute", new StandardSQLFunction( "minute", Hibernate.INTEGER ) );
    registerFunction( "second", new StandardSQLFunction( "second", Hibernate.INTEGER ) );
    registerFunction( "dayname", new StandardSQLFunction( "dayname", Hibernate.STRING ) );
    registerFunction( "monthname", new StandardSQLFunction( "monthname", Hibernate.STRING ) );

    registerFunction( "abs", new StandardSQLFunction( "abs" ) );
    registerFunction( "sign", new StandardSQLFunction( "sign", Hibernate.INTEGER ) );

    registerFunction( "acos", new StandardSQLFunction( "acos", Hibernate.DOUBLE ) );
    registerFunction( "asin", new StandardSQLFunction( "asin", Hibernate.DOUBLE ) );
    registerFunction( "atan", new StandardSQLFunction( "atan", Hibernate.DOUBLE ) );
    registerFunction( "cos", new StandardSQLFunction( "cos", Hibernate.DOUBLE ) );
    registerFunction( "cot", new StandardSQLFunction( "cot", Hibernate.DOUBLE ) );
    registerFunction( "exp", new StandardSQLFunction( "exp", Hibernate.DOUBLE ) );
    registerFunction( "log", new StandardSQLFunction( "log", Hibernate.DOUBLE ) );
    registerFunction( "log10", new StandardSQLFunction( "log10", Hibernate.DOUBLE ) );
    registerFunction( "sin", new StandardSQLFunction( "sin", Hibernate.DOUBLE ) );
    registerFunction( "sqrt", new StandardSQLFunction( "sqrt", Hibernate.DOUBLE ) );
    registerFunction( "tan", new StandardSQLFunction( "tan", Hibernate.DOUBLE ) );
    registerFunction( "pi", new NoArgSQLFunction( "pi", Hibernate.DOUBLE ) );
    registerFunction( "rand", new StandardSQLFunction( "rand", Hibernate.FLOAT ) );

    registerFunction( "radians", new StandardSQLFunction( "radians", Hibernate.DOUBLE ) );
    registerFunction( "degrees", new StandardSQLFunction( "degrees", Hibernate.DOUBLE ) );
    registerFunction( "roundmagic", new StandardSQLFunction( "roundmagic" ) );

    registerFunction( "ceiling", new StandardSQLFunction( "ceiling" ) );
    registerFunction( "floor", new StandardSQLFunction( "floor" ) );

    // Multi-param dialect functions...
    registerFunction( "mod", new StandardSQLFunction( "mod", Hibernate.INTEGER ) );

    // function templates
    registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "(", "||", ")" ) );

    getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE );
View Full Code Here

    registerColumnType( Types.VARBINARY, "varbinary" );
    registerColumnType( Types.NUMERIC, "numeric" );
    registerColumnType( Types.BLOB, "blob" );
    registerColumnType( Types.CLOB, "clob" );

    registerFunction( "upper", new StandardSQLFunction("upper") );
    registerFunction( "lower", new StandardSQLFunction("lower") );
    registerFunction( "sqrt", new StandardSQLFunction("sqrt", Hibernate.DOUBLE) );
    registerFunction( "abs", new StandardSQLFunction("abs") );
    registerFunction( "sign", new StandardSQLFunction( "sign", Hibernate.INTEGER ) );
    registerFunction( "length", new StandardSQLFunction( "length", Hibernate.INTEGER ) );
    registerFunction( "round", new StandardSQLFunction( "round", Hibernate.INTEGER ) );
    registerFunction( "mod", new StandardSQLFunction( "mod", Hibernate.INTEGER ) );
    registerFunction( "least", new StandardSQLFunction("least") );
    registerFunction( "greatest", new StandardSQLFunction("greatest") );
    registerFunction( "user", new StandardSQLFunction( "user", Hibernate.STRING ) );
    registerFunction( "concat", new StandardSQLFunction( "concat", Hibernate.STRING ) );

    getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH);
  }
View Full Code Here

    // where section like 'Function%' order by section, topic
    //
    // see also ->  http://www.h2database.com/html/functions.html

    // Numeric Functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    registerFunction( "acos", new StandardSQLFunction( "acos", StandardBasicTypes.DOUBLE ) );
    registerFunction( "asin", new StandardSQLFunction( "asin", StandardBasicTypes.DOUBLE ) );
    registerFunction( "atan", new StandardSQLFunction( "atan", StandardBasicTypes.DOUBLE ) );
    registerFunction( "atan2", new StandardSQLFunction( "atan2", StandardBasicTypes.DOUBLE ) );
    registerFunction( "bitand", new StandardSQLFunction( "bitand", StandardBasicTypes.INTEGER ) );
    registerFunction( "bitor", new StandardSQLFunction( "bitor", StandardBasicTypes.INTEGER ) );
    registerFunction( "bitxor", new StandardSQLFunction( "bitxor", StandardBasicTypes.INTEGER ) );
    registerFunction( "ceiling", new StandardSQLFunction( "ceiling", StandardBasicTypes.DOUBLE ) );
    registerFunction( "cos", new StandardSQLFunction( "cos", StandardBasicTypes.DOUBLE ) );
    registerFunction( "compress", new StandardSQLFunction( "compress", StandardBasicTypes.BINARY ) );
    registerFunction( "cot", new StandardSQLFunction( "cot", StandardBasicTypes.DOUBLE ) );
    registerFunction( "decrypt", new StandardSQLFunction( "decrypt", StandardBasicTypes.BINARY ) );
    registerFunction( "degrees", new StandardSQLFunction( "degrees", StandardBasicTypes.DOUBLE ) );
    registerFunction( "encrypt", new StandardSQLFunction( "encrypt", StandardBasicTypes.BINARY ) );
    registerFunction( "exp", new StandardSQLFunction( "exp", StandardBasicTypes.DOUBLE ) );
    registerFunction( "expand", new StandardSQLFunction( "compress", StandardBasicTypes.BINARY ) );
    registerFunction( "floor", new StandardSQLFunction( "floor", StandardBasicTypes.DOUBLE ) );
    registerFunction( "hash", new StandardSQLFunction( "hash", StandardBasicTypes.BINARY ) );
    registerFunction( "log", new StandardSQLFunction( "log", StandardBasicTypes.DOUBLE ) );
    registerFunction( "log10", new StandardSQLFunction( "log10", StandardBasicTypes.DOUBLE ) );
    registerFunction( "pi", new NoArgSQLFunction( "pi", StandardBasicTypes.DOUBLE ) );
    registerFunction( "power", new StandardSQLFunction( "power", StandardBasicTypes.DOUBLE ) );
    registerFunction( "radians", new StandardSQLFunction( "radians", StandardBasicTypes.DOUBLE ) );
    registerFunction( "rand", new NoArgSQLFunction( "rand", StandardBasicTypes.DOUBLE ) );
    registerFunction( "round", new StandardSQLFunction( "round", StandardBasicTypes.DOUBLE ) );
    registerFunction( "roundmagic", new StandardSQLFunction( "roundmagic", StandardBasicTypes.DOUBLE ) );
    registerFunction( "sign", new StandardSQLFunction( "sign", StandardBasicTypes.INTEGER ) );
    registerFunction( "sin", new StandardSQLFunction( "sin", StandardBasicTypes.DOUBLE ) );
    registerFunction( "tan", new StandardSQLFunction( "tan", StandardBasicTypes.DOUBLE ) );
    registerFunction( "truncate", new StandardSQLFunction( "truncate", StandardBasicTypes.DOUBLE ) );

    // String Functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    registerFunction( "ascii", new StandardSQLFunction( "ascii", StandardBasicTypes.INTEGER ) );
    registerFunction( "char", new StandardSQLFunction( "char", StandardBasicTypes.CHARACTER ) );
    registerFunction( "concat", new VarArgsSQLFunction( StandardBasicTypes.STRING, "(", "||", ")" ) );
    registerFunction( "difference", new StandardSQLFunction( "difference", StandardBasicTypes.INTEGER ) );
    registerFunction( "hextoraw", new StandardSQLFunction( "hextoraw", StandardBasicTypes.STRING ) );
    registerFunction( "insert", new StandardSQLFunction( "lower", StandardBasicTypes.STRING ) );
    registerFunction( "left", new StandardSQLFunction( "left", StandardBasicTypes.STRING ) );
    registerFunction( "lcase", new StandardSQLFunction( "lcase", StandardBasicTypes.STRING ) );
    registerFunction( "ltrim", new StandardSQLFunction( "ltrim", StandardBasicTypes.STRING ) );
    registerFunction( "octet_length", new StandardSQLFunction( "octet_length", StandardBasicTypes.INTEGER ) );
    registerFunction( "position", new StandardSQLFunction( "position", StandardBasicTypes.INTEGER ) );
    registerFunction( "rawtohex", new StandardSQLFunction( "rawtohex", StandardBasicTypes.STRING ) );
    registerFunction( "repeat", new StandardSQLFunction( "repeat", StandardBasicTypes.STRING ) );
    registerFunction( "replace", new StandardSQLFunction( "replace", StandardBasicTypes.STRING ) );
    registerFunction( "right", new StandardSQLFunction( "right", StandardBasicTypes.STRING ) );
    registerFunction( "rtrim", new StandardSQLFunction( "rtrim", StandardBasicTypes.STRING ) );
    registerFunction( "soundex", new StandardSQLFunction( "soundex", StandardBasicTypes.STRING ) );
    registerFunction( "space", new StandardSQLFunction( "space", StandardBasicTypes.STRING ) );
    registerFunction( "stringencode", new StandardSQLFunction( "stringencode", StandardBasicTypes.STRING ) );
    registerFunction( "stringdecode", new StandardSQLFunction( "stringdecode", StandardBasicTypes.STRING ) );
    registerFunction( "stringtoutf8", new StandardSQLFunction( "stringtoutf8", StandardBasicTypes.BINARY ) );
    registerFunction( "ucase", new StandardSQLFunction( "ucase", StandardBasicTypes.STRING ) );
    registerFunction( "utf8tostring", new StandardSQLFunction( "utf8tostring", StandardBasicTypes.STRING ) );

    // Time and Date Functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    registerFunction( "curdate", new NoArgSQLFunction( "curdate", StandardBasicTypes.DATE ) );
    registerFunction( "curtime", new NoArgSQLFunction( "curtime", StandardBasicTypes.TIME ) );
    registerFunction( "curtimestamp", new NoArgSQLFunction( "curtimestamp", StandardBasicTypes.TIME ) );
    registerFunction( "current_date", new NoArgSQLFunction( "current_date", StandardBasicTypes.DATE ) );
    registerFunction( "current_time", new NoArgSQLFunction( "current_time", StandardBasicTypes.TIME ) );
    registerFunction( "current_timestamp", new NoArgSQLFunction( "current_timestamp", StandardBasicTypes.TIMESTAMP ) );
    registerFunction( "datediff", new StandardSQLFunction( "datediff", StandardBasicTypes.INTEGER ) );
    registerFunction( "dayname", new StandardSQLFunction( "dayname", StandardBasicTypes.STRING ) );
    registerFunction( "dayofmonth", new StandardSQLFunction( "dayofmonth", StandardBasicTypes.INTEGER ) );
    registerFunction( "dayofweek", new StandardSQLFunction( "dayofweek", StandardBasicTypes.INTEGER ) );
    registerFunction( "dayofyear", new StandardSQLFunction( "dayofyear", StandardBasicTypes.INTEGER ) );
    registerFunction( "monthname", new StandardSQLFunction( "monthname", StandardBasicTypes.STRING ) );
    registerFunction( "now", new NoArgSQLFunction( "now", StandardBasicTypes.TIMESTAMP ) );
    registerFunction( "quarter", new StandardSQLFunction( "quarter", StandardBasicTypes.INTEGER ) );
    registerFunction( "week", new StandardSQLFunction( "week", StandardBasicTypes.INTEGER ) );

    // System Functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    registerFunction( "database", new NoArgSQLFunction( "database", StandardBasicTypes.STRING ) );
    registerFunction( "user", new NoArgSQLFunction( "user", StandardBasicTypes.STRING ) );
View Full Code Here

    registerColumnType( Types.CLOB, "longtext" );
//    registerColumnType( Types.CLOB, 16777215, "mediumtext" );
//    registerColumnType( Types.CLOB, 65535, "text" );
    registerVarcharTypes();

    registerFunction("ascii", new StandardSQLFunction("ascii", StandardBasicTypes.INTEGER) );
    registerFunction("bin", new StandardSQLFunction("bin", StandardBasicTypes.STRING) );
    registerFunction("char_length", new StandardSQLFunction("char_length", StandardBasicTypes.LONG) );
    registerFunction("character_length", new StandardSQLFunction("character_length", StandardBasicTypes.LONG) );
    registerFunction("lcase", new StandardSQLFunction("lcase") );
    registerFunction("lower", new StandardSQLFunction("lower") );
    registerFunction("ltrim", new StandardSQLFunction("ltrim") );
    registerFunction("ord", new StandardSQLFunction("ord", StandardBasicTypes.INTEGER) );
    registerFunction("quote", new StandardSQLFunction("quote") );
    registerFunction("reverse", new StandardSQLFunction("reverse") );
    registerFunction("rtrim", new StandardSQLFunction("rtrim") );
    registerFunction("soundex", new StandardSQLFunction("soundex") );
    registerFunction("space", new StandardSQLFunction("space", StandardBasicTypes.STRING) );
    registerFunction("ucase", new StandardSQLFunction("ucase") );
    registerFunction("upper", new StandardSQLFunction("upper") );
    registerFunction("unhex", new StandardSQLFunction("unhex", StandardBasicTypes.STRING) );

    registerFunction("abs", new StandardSQLFunction("abs") );
    registerFunction("sign", new StandardSQLFunction("sign", StandardBasicTypes.INTEGER) );

    registerFunction("acos", new StandardSQLFunction("acos", StandardBasicTypes.DOUBLE) );
    registerFunction("asin", new StandardSQLFunction("asin", StandardBasicTypes.DOUBLE) );
    registerFunction("atan", new StandardSQLFunction("atan", StandardBasicTypes.DOUBLE) );
    registerFunction("cos", new StandardSQLFunction("cos", StandardBasicTypes.DOUBLE) );
    registerFunction("cot", new StandardSQLFunction("cot", StandardBasicTypes.DOUBLE) );
    registerFunction("crc32", new StandardSQLFunction("crc32", StandardBasicTypes.LONG) );
    registerFunction("exp", new StandardSQLFunction("exp", StandardBasicTypes.DOUBLE) );
    registerFunction("ln", new StandardSQLFunction("ln", StandardBasicTypes.DOUBLE) );
    registerFunction("log", new StandardSQLFunction("log", StandardBasicTypes.DOUBLE) );
    registerFunction("log2", new StandardSQLFunction("log2", StandardBasicTypes.DOUBLE) );
    registerFunction("log10", new StandardSQLFunction("log10", StandardBasicTypes.DOUBLE) );
    registerFunction("pi", new NoArgSQLFunction("pi", StandardBasicTypes.DOUBLE) );
    registerFunction("rand", new NoArgSQLFunction("rand", StandardBasicTypes.DOUBLE) );
    registerFunction("sin", new StandardSQLFunction("sin", StandardBasicTypes.DOUBLE) );
    registerFunction("sqrt", new StandardSQLFunction("sqrt", StandardBasicTypes.DOUBLE) );
    registerFunction("tan", new StandardSQLFunction("tan", StandardBasicTypes.DOUBLE) );

    registerFunction("radians", new StandardSQLFunction("radians", StandardBasicTypes.DOUBLE) );
    registerFunction("degrees", new StandardSQLFunction("degrees", StandardBasicTypes.DOUBLE) );

    registerFunction("ceiling", new StandardSQLFunction("ceiling", StandardBasicTypes.INTEGER) );
    registerFunction("ceil", new StandardSQLFunction("ceil", StandardBasicTypes.INTEGER) );
    registerFunction("floor", new StandardSQLFunction("floor", StandardBasicTypes.INTEGER) );
    registerFunction("round", new StandardSQLFunction("round") );

    registerFunction("datediff", new StandardSQLFunction("datediff", StandardBasicTypes.INTEGER) );
    registerFunction("timediff", new StandardSQLFunction("timediff", StandardBasicTypes.TIME) );
    registerFunction("date_format", new StandardSQLFunction("date_format", StandardBasicTypes.STRING) );

    registerFunction("curdate", new NoArgSQLFunction("curdate", StandardBasicTypes.DATE) );
    registerFunction("curtime", new NoArgSQLFunction("curtime", StandardBasicTypes.TIME) );
    registerFunction("current_date", new NoArgSQLFunction("current_date", StandardBasicTypes.DATE, false) );
    registerFunction("current_time", new NoArgSQLFunction("current_time", StandardBasicTypes.TIME, false) );
    registerFunction("current_timestamp", new NoArgSQLFunction("current_timestamp", StandardBasicTypes.TIMESTAMP, false) );
    registerFunction("date", new StandardSQLFunction("date", StandardBasicTypes.DATE) );
    registerFunction("day", new StandardSQLFunction("day", StandardBasicTypes.INTEGER) );
    registerFunction("dayofmonth", new StandardSQLFunction("dayofmonth", StandardBasicTypes.INTEGER) );
    registerFunction("dayname", new StandardSQLFunction("dayname", StandardBasicTypes.STRING) );
    registerFunction("dayofweek", new StandardSQLFunction("dayofweek", StandardBasicTypes.INTEGER) );
    registerFunction("dayofyear", new StandardSQLFunction("dayofyear", StandardBasicTypes.INTEGER) );
    registerFunction("from_days", new StandardSQLFunction("from_days", StandardBasicTypes.DATE) );
    registerFunction("from_unixtime", new StandardSQLFunction("from_unixtime", StandardBasicTypes.TIMESTAMP) );
    registerFunction("hour", new StandardSQLFunction("hour", StandardBasicTypes.INTEGER) );
    registerFunction("last_day", new StandardSQLFunction("last_day", StandardBasicTypes.DATE) );
    registerFunction("localtime", new NoArgSQLFunction("localtime", StandardBasicTypes.TIMESTAMP) );
    registerFunction("localtimestamp", new NoArgSQLFunction("localtimestamp", StandardBasicTypes.TIMESTAMP) );
    registerFunction("microseconds", new StandardSQLFunction("microseconds", StandardBasicTypes.INTEGER) );
    registerFunction("minute", new StandardSQLFunction("minute", StandardBasicTypes.INTEGER) );
    registerFunction("month", new StandardSQLFunction("month", StandardBasicTypes.INTEGER) );
    registerFunction("monthname", new StandardSQLFunction("monthname", StandardBasicTypes.STRING) );
    registerFunction("now", new NoArgSQLFunction("now", StandardBasicTypes.TIMESTAMP) );
    registerFunction("quarter", new StandardSQLFunction("quarter", StandardBasicTypes.INTEGER) );
    registerFunction("second", new StandardSQLFunction("second", StandardBasicTypes.INTEGER) );
    registerFunction("sec_to_time", new StandardSQLFunction("sec_to_time", StandardBasicTypes.TIME) );
    registerFunction("sysdate", new NoArgSQLFunction("sysdate", StandardBasicTypes.TIMESTAMP) );
    registerFunction("time", new StandardSQLFunction("time", StandardBasicTypes.TIME) );
    registerFunction("timestamp", new StandardSQLFunction("timestamp", StandardBasicTypes.TIMESTAMP) );
    registerFunction("time_to_sec", new StandardSQLFunction("time_to_sec", StandardBasicTypes.INTEGER) );
    registerFunction("to_days", new StandardSQLFunction("to_days", StandardBasicTypes.LONG) );
    registerFunction("unix_timestamp", new StandardSQLFunction("unix_timestamp", StandardBasicTypes.LONG) );
    registerFunction("utc_date", new NoArgSQLFunction("utc_date", StandardBasicTypes.STRING) );
    registerFunction("utc_time", new NoArgSQLFunction("utc_time", StandardBasicTypes.STRING) );
    registerFunction("utc_timestamp", new NoArgSQLFunction("utc_timestamp", StandardBasicTypes.STRING) );
    registerFunction("week", new StandardSQLFunction("week", StandardBasicTypes.INTEGER) );
    registerFunction("weekday", new StandardSQLFunction("weekday", StandardBasicTypes.INTEGER) );
    registerFunction("weekofyear", new StandardSQLFunction("weekofyear", StandardBasicTypes.INTEGER) );
    registerFunction("year", new StandardSQLFunction("year", StandardBasicTypes.INTEGER) );
    registerFunction("yearweek", new StandardSQLFunction("yearweek", StandardBasicTypes.INTEGER) );

    registerFunction("hex", new StandardSQLFunction("hex", StandardBasicTypes.STRING) );
    registerFunction("oct", new StandardSQLFunction("oct", StandardBasicTypes.STRING) );

    registerFunction("octet_length", new StandardSQLFunction("octet_length", StandardBasicTypes.LONG) );
    registerFunction("bit_length", new StandardSQLFunction("bit_length", StandardBasicTypes.LONG) );

    registerFunction("bit_count", new StandardSQLFunction("bit_count", StandardBasicTypes.LONG) );
    registerFunction("encrypt", new StandardSQLFunction("encrypt", StandardBasicTypes.STRING) );
    registerFunction("md5", new StandardSQLFunction("md5", StandardBasicTypes.STRING) );
    registerFunction("sha1", new StandardSQLFunction("sha1", StandardBasicTypes.STRING) );
    registerFunction("sha", new StandardSQLFunction("sha", StandardBasicTypes.STRING) );

    registerFunction( "concat", new StandardSQLFunction( "concat", StandardBasicTypes.STRING ) );

    getDefaultProperties().setProperty(Environment.MAX_FETCH_DEPTH, "2");
    getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE);
  }
View Full Code Here

TOP

Related Classes of org.hibernate.dialect.function.StandardSQLFunction

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.