Package org.hibernate.dialect.function

Examples of org.hibernate.dialect.function.VarArgsSQLFunction


    registerColumnType(Types.VARBINARY, "byte");
    registerColumnType(Types.VARCHAR, "varchar($l)");
    registerColumnType(Types.VARCHAR, 255, "varchar($l)");
    registerColumnType(Types.VARCHAR, 32739, "lvarchar($l)");

    registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "(", "||", ")" ) );
  }
View Full Code Here


    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) );
    registerFunction( "lpad", new StandardSQLFunction("lpad", Hibernate.STRING) );
    registerFunction( "replace", new StandardSQLFunction("replace", Hibernate.STRING) );
    registerFunction( "rpad", new StandardSQLFunction("rpad", Hibernate.STRING) );
View Full Code Here

    registerColumnType( Types.BLOB, "BLOB" );
    registerColumnType( Types.CLOB, "CLOB" );

    registerFunction( "year", new SQLFunctionTemplate( Hibernate.INTEGER, "extract(year from ?1)" ) );
    registerFunction( "length", new SQLFunctionTemplate( Hibernate.INTEGER, "character_length(?1)" ) );
    registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "(", "||", ")" ) );
    registerFunction( "substring", new SQLFunctionTemplate( Hibernate.STRING, "substring(?1 from ?2 for ?3)" ) );
    registerFunction( "locate", new SQLFunctionTemplate( Hibernate.STRING, "position(?1 in ?2)" ) );
    registerFunction( "mod", new SQLFunctionTemplate( Hibernate.STRING, "?1 mod ?2" ) );
    registerFunction( "str", new SQLFunctionTemplate( Hibernate.STRING, "cast(?1 as varchar(255))" ) );
View Full Code Here

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

    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() );

    registerFunction( "str", new SQLFunctionTemplate(Hibernate.STRING, "cast(?1 as varchar)") );
View Full Code Here

    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
    registerFunction( "year", new StandardJDBCEscapeFunction( "year", Hibernate.INTEGER ) );
  }
View Full Code Here

    // xmlforest requires a new kind of function constructor
    registerFunction( "year", new StandardJDBCEscapeFunction( "year", Hibernate.INTEGER ) );
  }

  protected final void register71Functions() {
    this.registerFunction( "str", new VarArgsSQLFunction( Hibernate.STRING, "str(", ",", ")" ) );
  }
View Full Code Here

    // 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

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

public class Ingres9Dialect extends IngresDialect {
    public Ingres9Dialect() {
        super();
        registerDateTimeFunctions();
        registerDateTimeColumnTypes();
        registerFunction( "concat", new VarArgsSQLFunction( StandardBasicTypes.STRING, "(", "||", ")" ) );
    }
View Full Code Here

TOP

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

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.