registerFunction( "avg", new AvgWithArgumentCastFunction( "double" ) ); registerFunction( "ascii", new StandardSQLFunction( "ascii", StandardBasicTypes.INTEGER ) ); registerFunction( "char", new StandardSQLFunction( "char", StandardBasicTypes.CHARACTER ) ); 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", StandardBasicTypes.STRING ) ); registerFunction( "ltrim", new StandardSQLFunction( "ltrim" ) ); registerFunction( "rtrim", new StandardSQLFunction( "rtrim" ) ); registerFunction( "reverse", new StandardSQLFunction( "reverse" ) ); registerFunction( "space", new StandardSQLFunction( "space", StandardBasicTypes.STRING ) ); registerFunction( "str", new SQLFunctionTemplate( StandardBasicTypes.STRING, "cast(?1 as varchar(256))" ) ); registerFunction( "to_char", new StandardSQLFunction( "to_char", StandardBasicTypes.STRING ) ); registerFunction( "rawtohex", new StandardSQLFunction( "rawtohex" ) ); registerFunction( "hextoraw", new StandardSQLFunction( "hextoraw" ) ); registerFunction( "user", new NoArgSQLFunction( "user", StandardBasicTypes.STRING ) ); registerFunction( "database", new NoArgSQLFunction( "database", StandardBasicTypes.STRING ) ); registerFunction( "sysdate", new NoArgSQLFunction( "sysdate", StandardBasicTypes.DATE, false ) ); registerFunction( "sysdate", new NoArgSQLFunction( "sysdate", StandardBasicTypes.TIMESTAMP, false ) ); registerFunction( "current_date", new NoArgSQLFunction( "current_date", StandardBasicTypes.DATE, false ) ); registerFunction( "curdate", new NoArgSQLFunction( "curdate", StandardBasicTypes.DATE ) ); registerFunction( "current_timestamp", new NoArgSQLFunction( "current_timestamp", StandardBasicTypes.TIMESTAMP, false )
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( "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( "avg", new AvgWithArgumentCastFunction( "double" ) ); registerFunction( "ascii", new StandardSQLFunction( "ascii", StandardBasicTypes.INTEGER ) ); registerFunction( "char", new StandardSQLFunction( "char", StandardBasicTypes.CHARACTER ) ); 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", StandardBasicTypes.STRING ) ); registerFunction( "ltrim", new StandardSQLFunction( "ltrim" ) ); registerFunction( "rtrim", new StandardSQLFunction( "rtrim" ) ); registerFunction( "reverse", new StandardSQLFunction( "reverse" ) ); registerFunction( "space", new StandardSQLFunction( "space", StandardBasicTypes.STRING ) ); registerFunction( "str", new SQLFunctionTemplate( StandardBasicTypes.STRING, "cast(?1 as varchar(256))" ) ); registerFunction( "to_char", new StandardSQLFunction( "to_char" ) ); registerFunction( "rawtohex", new StandardSQLFunction( "rawtohex" ) ); registerFunction( "hextoraw", new StandardSQLFunction( "hextoraw" ) ); registerFunction( "user", new NoArgSQLFunction( "user", StandardBasicTypes.STRING ) ); registerFunction( "database", new NoArgSQLFunction( "database", StandardBasicTypes.STRING ) ); registerFunction( "sysdate", new NoArgSQLFunction( "sysdate", StandardBasicTypes.DATE, false ) ); } else { registerFunction( "sysdate", new NoArgSQLFunction( "sysdate", StandardBasicTypes.TIMESTAMP, false ) ); registerFunction( "current_date", new NoArgSQLFunction( "current_date", StandardBasicTypes.DATE, false ) ); registerFunction( "curdate", new NoArgSQLFunction( "curdate", StandardBasicTypes.DATE ) ); registerFunction( "current_timestamp", new NoArgSQLFunction( "current_timestamp", StandardBasicTypes.TIMESTAMP, false )
registerFunction( "avg", new AvgWithArgumentCastFunction( "double" ) ); registerFunction( "ascii", new StandardSQLFunction( "ascii", StandardBasicTypes.INTEGER ) ); registerFunction( "char", new StandardSQLFunction( "char", StandardBasicTypes.CHARACTER ) ); 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", StandardBasicTypes.STRING ) ); registerFunction( "ltrim", new StandardSQLFunction( "ltrim" ) ); registerFunction( "rtrim", new StandardSQLFunction( "rtrim" ) ); registerFunction( "reverse", new StandardSQLFunction( "reverse" ) ); registerFunction( "space", new StandardSQLFunction( "space", StandardBasicTypes.STRING ) ); registerFunction( "str", new SQLFunctionTemplate( StandardBasicTypes.STRING, "cast(?1 as varchar(256))" ) ); registerFunction( "to_char", new StandardSQLFunction( "to_char" ) ); registerFunction( "rawtohex", new StandardSQLFunction( "rawtohex" ) ); registerFunction( "hextoraw", new StandardSQLFunction( "hextoraw" ) ); registerFunction( "user", new NoArgSQLFunction( "user", StandardBasicTypes.STRING ) ); registerFunction( "database", new NoArgSQLFunction( "database", StandardBasicTypes.STRING ) ); registerFunction( "sysdate", new NoArgSQLFunction( "sysdate", StandardBasicTypes.DATE, false ) ); } else { registerFunction( "sysdate", new NoArgSQLFunction( "sysdate", StandardBasicTypes.TIMESTAMP, false ) ); registerFunction( "current_date", new NoArgSQLFunction( "current_date", StandardBasicTypes.DATE, false ) ); registerFunction( "curdate", new NoArgSQLFunction( "curdate", StandardBasicTypes.DATE ) ); registerFunction( "current_timestamp", new NoArgSQLFunction( "current_timestamp", StandardBasicTypes.TIMESTAMP, false )