registerFunction( "substring", new SQLFunctionTemplate(StandardBasicTypes.STRING, "substring(?1 FROM ?2 FOR ?3)")); registerFunction( "substr", new SQLFunctionTemplate( StandardBasicTypes.STRING, "substr(?1, ?2, ?3)")); registerFunction( "coalesce", new NvlFunction()); registerFunction( "nvl", new NvlFunction()); registerFunction( "current_timestamp", new NoArgSQLFunction( "current", StandardBasicTypes.TIMESTAMP, false ) ); registerFunction( "current_date", new NoArgSQLFunction( "today", StandardBasicTypes.DATE, false ) );
@Override @SuppressWarnings("unchecked") public String render(Type argumentType, List args, SessionFactoryImplementor factory) throws QueryException { final int lastIndex = args.size()-1; final Object last = args.remove( lastIndex ); if ( lastIndex==0 ) { return last.toString(); } final Object secondLast = args.get( lastIndex-1 ); final String nvl = "nvl(" + secondLast + ", " + last + ")"; args.set( lastIndex-1, nvl ); return render( argumentType, args, factory ); } }
/** * Constructs a PostgresPlusDialect */ public PostgresPlusDialect() { super(); registerFunction( "ltrim", new StandardSQLFunction( "ltrim" ) ); registerFunction( "rtrim", new StandardSQLFunction( "rtrim" ) ); registerFunction( "soundex", new StandardSQLFunction( "soundex" ) ); registerFunction( "sysdate", new NoArgSQLFunction( "sysdate", StandardBasicTypes.DATE, false ) ); registerFunction( "rowid", new NoArgSQLFunction( "rowid", StandardBasicTypes.LONG, false ) ); registerFunction( "rownum", new NoArgSQLFunction( "rownum", StandardBasicTypes.LONG, false ) ); registerFunction( "instr", new StandardSQLFunction( "instr", StandardBasicTypes.INTEGER ) ); registerFunction( "lpad", new StandardSQLFunction( "lpad", StandardBasicTypes.STRING ) ); registerFunction( "replace", new StandardSQLFunction( "replace", StandardBasicTypes.STRING ) ); registerFunction( "rpad", new StandardSQLFunction( "rpad", StandardBasicTypes.STRING ) ); registerFunction( "translate", new StandardSQLFunction( "translate", StandardBasicTypes.STRING ) ); registerFunction( "substring", new StandardSQLFunction( "substr", StandardBasicTypes.STRING ) ); registerFunction( "coalesce", new NvlFunction() ); registerFunction( "atan2", new StandardSQLFunction( "atan2", StandardBasicTypes.FLOAT ) ); registerFunction( "mod", new StandardSQLFunction( "mod", StandardBasicTypes.INTEGER ) ); registerFunction( "nvl", new StandardSQLFunction( "nvl" ) ); registerFunction( "nvl2", new StandardSQLFunction( "nvl2" ) ); registerFunction( "power", new StandardSQLFunction( "power", StandardBasicTypes.FLOAT ) ); registerFunction( "add_months", new StandardSQLFunction( "add_months", StandardBasicTypes.DATE ) ); registerFunction( "months_between", new StandardSQLFunction( "months_between", StandardBasicTypes.FLOAT ) ); registerFunction( "next_day", new StandardSQLFunction( "next_day", StandardBasicTypes.DATE ) ); }
public String render(Type argumentType, List args, SessionFactoryImplementor factory) throws QueryException { int lastIndex = args.size()-1; Object last = args.remove(lastIndex); if ( lastIndex==0 ) { return last.toString(); } Object secondLast = args.get(lastIndex-1); String nvl = "nvl(" + secondLast + ", " + last + ")"; args.set(lastIndex-1, nvl); return render( argumentType, args, factory ); }
registerFunction( "locate", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "instr(?2,?1)" ) ); registerFunction( "bit_length", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "vsize(?1)*8" ) ); registerFunction( "coalesce", new NvlFunction() );
public String render(List args, SessionFactoryImplementor factory) throws QueryException { int lastIndex = args.size()-1; Object last = args.remove(lastIndex); if ( lastIndex==0 ) return last.toString(); Object secondLast = args.get(lastIndex-1); String nvl = "nvl(" + secondLast + ", " + last + ")"; args.set(lastIndex-1, nvl); return render(args, factory); }
registerFunction( "locate", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "instr(?2,?1)" ) ); registerFunction( "bit_length", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "vsize(?1)*8" ) ); registerFunction( "coalesce", new NvlFunction() );
public String render(Type argumentType, List args, SessionFactoryImplementor factory) throws QueryException { int lastIndex = args.size()-1; Object last = args.remove(lastIndex); if ( lastIndex==0 ) { return last.toString(); } Object secondLast = args.get(lastIndex-1); String nvl = "nvl(" + secondLast + ", " + last + ")"; args.set(lastIndex-1, nvl); return render( argumentType, args, factory ); }
registerFunction( "now", new StandardJDBCEscapeFunction( "monthname", StandardBasicTypes.TIMESTAMP ) ); registerFunction( "nullif", new VarArgsSQLFunction( "nullif(", ",", ")" ) ); registerFunction( "nvl", new NvlFunction() ); registerFunction( "%odbcin", new StandardSQLFunction( "%odbcin" ) ); registerFunction( "%odbcout", new StandardSQLFunction( "%odbcin" ) );
public String render(List args, SessionFactoryImplementor factory) throws QueryException { int lastIndex = args.size()-1; Object last = args.remove(lastIndex); if ( lastIndex==0 ) return last.toString(); Object secondLast = args.get(lastIndex-1); String nvl = "nvl(" + secondLast + ", " + last + ")"; args.set(lastIndex-1, nvl); return render(args, factory); }
public PostgresPlusDialect() { super(); registerFunction( "ltrim", new StandardSQLFunction( "ltrim" ) ); registerFunction( "rtrim", new StandardSQLFunction( "rtrim" ) ); registerFunction( "soundex", new StandardSQLFunction( "soundex" ) ); registerFunction( "sysdate", new NoArgSQLFunction( "sysdate", StandardBasicTypes.DATE, false ) ); registerFunction( "rowid", new NoArgSQLFunction( "rowid", StandardBasicTypes.LONG, false ) ); registerFunction( "rownum", new NoArgSQLFunction( "rownum", StandardBasicTypes.LONG, false ) ); registerFunction( "instr", new StandardSQLFunction( "instr", StandardBasicTypes.INTEGER ) ); registerFunction( "lpad", new StandardSQLFunction( "lpad", StandardBasicTypes.STRING ) ); registerFunction( "replace", new StandardSQLFunction( "replace", StandardBasicTypes.STRING ) ); registerFunction( "rpad", new StandardSQLFunction( "rpad", StandardBasicTypes.STRING ) ); registerFunction( "translate", new StandardSQLFunction( "translate", StandardBasicTypes.STRING ) ); registerFunction( "substring", new StandardSQLFunction( "substr", StandardBasicTypes.STRING ) ); registerFunction( "coalesce", new NvlFunction() ); registerFunction( "atan2", new StandardSQLFunction( "atan2", StandardBasicTypes.FLOAT ) ); registerFunction( "mod", new StandardSQLFunction( "mod", StandardBasicTypes.INTEGER ) ); registerFunction( "nvl", new StandardSQLFunction( "nvl" ) ); registerFunction( "nvl2", new StandardSQLFunction( "nvl2" ) ); registerFunction( "power", new StandardSQLFunction( "power", StandardBasicTypes.FLOAT ) ); registerFunction( "add_months", new StandardSQLFunction( "add_months", StandardBasicTypes.DATE ) ); registerFunction( "months_between", new StandardSQLFunction( "months_between", StandardBasicTypes.FLOAT ) ); registerFunction( "next_day", new StandardSQLFunction( "next_day", StandardBasicTypes.DATE ) ); }
public PostgresPlusDialect() { super(); registerFunction( "ltrim", new StandardSQLFunction( "ltrim" ) ); registerFunction( "rtrim", new StandardSQLFunction( "rtrim" ) ); registerFunction( "soundex", new StandardSQLFunction( "soundex" ) ); registerFunction( "sysdate", new NoArgSQLFunction( "sysdate", StandardBasicTypes.DATE, false ) ); registerFunction( "rowid", new NoArgSQLFunction( "rowid", StandardBasicTypes.LONG, false ) ); registerFunction( "rownum", new NoArgSQLFunction( "rownum", StandardBasicTypes.LONG, false ) ); registerFunction( "instr", new StandardSQLFunction( "instr", StandardBasicTypes.INTEGER ) ); registerFunction( "lpad", new StandardSQLFunction( "lpad", StandardBasicTypes.STRING ) ); registerFunction( "replace", new StandardSQLFunction( "replace", StandardBasicTypes.STRING ) ); registerFunction( "rpad", new StandardSQLFunction( "rpad", StandardBasicTypes.STRING ) ); registerFunction( "translate", new StandardSQLFunction( "translate", StandardBasicTypes.STRING ) ); registerFunction( "substring", new StandardSQLFunction( "substr", StandardBasicTypes.STRING ) ); registerFunction( "coalesce", new NvlFunction() ); registerFunction( "atan2", new StandardSQLFunction( "atan2", StandardBasicTypes.FLOAT ) ); registerFunction( "mod", new StandardSQLFunction( "mod", StandardBasicTypes.INTEGER ) ); registerFunction( "nvl", new StandardSQLFunction( "nvl" ) ); registerFunction( "nvl2", new StandardSQLFunction( "nvl2" ) ); registerFunction( "power", new StandardSQLFunction( "power", StandardBasicTypes.FLOAT ) ); registerFunction( "add_months", new StandardSQLFunction( "add_months", StandardBasicTypes.DATE ) ); registerFunction( "months_between", new StandardSQLFunction( "months_between", StandardBasicTypes.FLOAT ) ); registerFunction( "next_day", new StandardSQLFunction( "next_day", StandardBasicTypes.DATE ) ); }
registerFunction("trim", new AnsiTrimFunction()); registerFunction("value", new StandardSQLFunction("coalesce")); registerFunction("nvl", new NvlFunction()); registerFunction("groups", new StandardSQLFunction("GROUPS", StandardBasicTypes.STRING));
registerFunction("trim", new AnsiTrimFunction()); registerFunction("value", new StandardSQLFunction("coalesce")); registerFunction("nvl", new NvlFunction()); registerFunction("groups", new StandardSQLFunction("GROUPS", StandardBasicTypes.STRING));
registerFunction( "locate", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "instr(?2,?1)" ) ); registerFunction( "bit_length", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "vsize(?1)*8" ) ); registerFunction( "coalesce", new NvlFunction() );
registerFunction( "locate", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "instr(?2,?1)" ) ); registerFunction( "bit_length", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "vsize(?1)*8" ) ); registerFunction( "coalesce", new NvlFunction() );
registerFunction( "locate", new SQLFunctionTemplate( Hibernate.INTEGER, "instr(?2,?1)" ) ); registerFunction( "bit_length", new SQLFunctionTemplate( Hibernate.INTEGER, "vsize(?1)*8" ) ); registerFunction( "coalesce", new NvlFunction() );
registerFunction( "locate", new StandardSQLFunction( "instr", Hibernate.INTEGER ) ); registerFunction( "bit_length", new SQLFunctionTemplate( Hibernate.INTEGER, "vsize(?1)*8" ) ); registerFunction( "coalesce", new NvlFunction() );
registerFunction( "now", new StandardJDBCEscapeFunction( "monthname", StandardBasicTypes.TIMESTAMP ) ); registerFunction( "nullif", new VarArgsSQLFunction( "nullif(", ",", ")" ) ); registerFunction( "nvl", new NvlFunction() ); registerFunction( "%odbcin", new StandardSQLFunction( "%odbcin" ) ); registerFunction( "%odbcout", new StandardSQLFunction( "%odbcin" ) );
registerFunction( "now", new StandardJDBCEscapeFunction( "monthname", StandardBasicTypes.TIMESTAMP ) ); registerFunction( "nullif", new VarArgsSQLFunction( "nullif(", ",", ")" ) ); registerFunction( "nvl", new NvlFunction() ); registerFunction( "%odbcin", new StandardSQLFunction( "%odbcin" ) ); registerFunction( "%odbcout", new StandardSQLFunction( "%odbcin" ) );