Package org.hibernate.dialect.function

Examples of org.hibernate.dialect.function.NoArgSQLFunction


    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) );
View Full Code Here


    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) );
View Full Code Here

    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

    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" ) );
View Full Code Here

        registerFunction("exp", new StandardSQLFunction("exp", Hibernate.DOUBLE));
        registerFunction("floor", new StandardSQLFunction("floor", Hibernate.DOUBLE));
        registerFunction("log", new StandardSQLFunction("log", Hibernate.DOUBLE));
        registerFunction("log10", new StandardSQLFunction("log10", Hibernate.DOUBLE));
//        registerFunction("mod", new StandardSQLFunction("mod", Hibernate.INTEGER));
        registerFunction("pi", new NoArgSQLFunction("pi", Hibernate.DOUBLE));
        registerFunction("power", new StandardSQLFunction("power", Hibernate.DOUBLE));
        registerFunction("radians", new StandardSQLFunction("radians", Hibernate.DOUBLE));
        registerFunction("rand", new NoArgSQLFunction("rand", Hibernate.DOUBLE));
        registerFunction("round", new StandardSQLFunction("round", Hibernate.DOUBLE));
        registerFunction("roundmagic", new StandardSQLFunction("roundmagic", Hibernate.DOUBLE));
        registerFunction("sign", new StandardSQLFunction("sign", Hibernate.INTEGER));
        registerFunction("sin", new StandardSQLFunction("sin", Hibernate.DOUBLE));
//        registerFunction("sqrt", new StandardSQLFunction("sqrt", Hibernate.DOUBLE));
        registerFunction("tan", new StandardSQLFunction("tan", Hibernate.DOUBLE));
        registerFunction("truncate", new StandardSQLFunction("truncate", Hibernate.DOUBLE));

        registerFunction("compress", new StandardSQLFunction("compress", Hibernate.BINARY));
        registerFunction("expand", new StandardSQLFunction("compress", Hibernate.BINARY));
        registerFunction("decrypt", new StandardSQLFunction("decrypt", Hibernate.BINARY));
        registerFunction("encrypt", new StandardSQLFunction("encrypt", Hibernate.BINARY));
        registerFunction("hash", new StandardSQLFunction("hash", Hibernate.BINARY));

        registerFunction("ascii", new StandardSQLFunction("ascii", Hibernate.INTEGER));
//        registerFunction("bit_length", new StandardSQLFunction("bit_length", Hibernate.INTEGER));
        registerFunction("char", new StandardSQLFunction("char", Hibernate.CHARACTER));
        registerFunction("concat", new VarArgsSQLFunction(Hibernate.STRING, "(", "||", ")"));
        registerFunction("difference", new StandardSQLFunction("difference", Hibernate.INTEGER));
        registerFunction("hextoraw", new StandardSQLFunction("hextoraw", Hibernate.STRING));
        registerFunction("lower", new StandardSQLFunction("lower", Hibernate.STRING));
        registerFunction("insert", new StandardSQLFunction("lower", Hibernate.STRING));
        registerFunction("left", new StandardSQLFunction("left", Hibernate.STRING));
//        registerFunction("length", new StandardSQLFunction("length", Hibernate.INTEGER));
//        registerFunction("locate", new StandardSQLFunction("locate", Hibernate.INTEGER));
//        registerFunction("lower", new StandardSQLFunction("lower", Hibernate.STRING));
        registerFunction("lcase", new StandardSQLFunction("lcase", Hibernate.STRING));
        registerFunction("ltrim", new StandardSQLFunction("ltrim", Hibernate.STRING));
        registerFunction("octet_length", new StandardSQLFunction("octet_length", Hibernate.INTEGER));
        registerFunction("position", new StandardSQLFunction("position", Hibernate.INTEGER));
        registerFunction("rawtohex", new StandardSQLFunction("rawtohex", Hibernate.STRING));
        registerFunction("repeat", new StandardSQLFunction("repeat", Hibernate.STRING));
        registerFunction("replace", new StandardSQLFunction("replace", Hibernate.STRING));
        registerFunction("right", new StandardSQLFunction("right", Hibernate.STRING));
        registerFunction("rtrim", new StandardSQLFunction("rtrim", Hibernate.STRING));
        registerFunction("soundex", new StandardSQLFunction("soundex", Hibernate.STRING));
        registerFunction("space", new StandardSQLFunction("space", Hibernate.STRING));
        registerFunction("stringencode", new StandardSQLFunction("stringencode", Hibernate.STRING));
        registerFunction("stringdecode", new StandardSQLFunction("stringdecode", Hibernate.STRING));
//        registerFunction("substring", new StandardSQLFunction("substring", Hibernate.STRING));
//        registerFunction("upper", new StandardSQLFunction("upper", Hibernate.STRING));
        registerFunction("ucase", new StandardSQLFunction("ucase", Hibernate.STRING));

        registerFunction("stringtoutf8", new StandardSQLFunction("stringtoutf8", Hibernate.BINARY));
        registerFunction("utf8tostring", new StandardSQLFunction("utf8tostring", Hibernate.STRING));

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

        registerFunction("curdate", new NoArgSQLFunction("curdate", Hibernate.DATE));
        registerFunction("curtime", new NoArgSQLFunction("curtime", Hibernate.TIME));
        registerFunction("curtimestamp", new NoArgSQLFunction("curtimestamp", Hibernate.TIME));
        registerFunction("now", new NoArgSQLFunction("now", Hibernate.TIMESTAMP));

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

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

    }
View Full Code Here

    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

    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" ) );
View Full Code Here

    registerFunction( "length", new StandardSQLFunction("length", Hibernate.LONG) );

    registerFunction( "to_char", new StandardSQLFunction("to_char", Hibernate.STRING) );
    registerFunction( "to_date", new StandardSQLFunction("to_date", Hibernate.TIMESTAMP) );

    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( "last_day", new StandardSQLFunction("last_day", Hibernate.DATE) );
    registerFunction( "sysdate", new NoArgSQLFunction("sysdate", Hibernate.DATE, false) );
    registerFunction( "systimestamp", new NoArgSQLFunction("systimestamp", Hibernate.TIMESTAMP, false) );
    registerFunction( "uid", new NoArgSQLFunction("uid", Hibernate.INTEGER, false) );
    registerFunction( "user", new NoArgSQLFunction("user", Hibernate.STRING, false) );

    registerFunction( "rowid", new NoArgSQLFunction("rowid", Hibernate.LONG, false) );
    registerFunction( "rownum", new NoArgSQLFunction("rownum", Hibernate.LONG, false) );

    // Multi-param string dialect functions...
    registerFunction( "concat", new VarArgsSQLFunction(Hibernate.STRING, "", "||", "") );
    registerFunction( "instr", new StandardSQLFunction("instr", Hibernate.INTEGER) );
    registerFunction( "instrb", new StandardSQLFunction("instrb", Hibernate.INTEGER) );
View Full Code Here

  public SQLServer2008Dialect(){
    registerColumnType( Types.DATE, "date" );
    registerColumnType( Types.TIME, "time" );
    registerColumnType( Types.TIMESTAMP, "datetime2" );
   
    registerFunction( "current_timestamp", new NoArgSQLFunction("current_timestamp", Hibernate.TIMESTAMP,false) );
  }
View Full Code Here

    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(", ",", ")" ) );
View Full Code Here

TOP

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

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.