@Override public String render(Type firstArgumentType, List arguments, SessionFactoryImplementor sessionFactory) { final boolean hasArgs = !arguments.isEmpty(); final StringBuilder buf = new StringBuilder( getName() ); if ( hasArgs ) { buf.append( "(" ); for ( int i = 0; i < arguments.size(); i++ ) { buf.append( arguments.get( i ) ); if ( i < arguments.size() - 1 ) { buf.append( ", " ); } } buf.append( ")" ); } return buf.toString(); } }
registerFunction( "current_time", new NoArgSQLFunction( "current_time", StandardBasicTypes.TIME, false ) ); registerFunction( "current_timestamp", new ConditionalParenthesisFunction( "current_timestamp", StandardBasicTypes.TIMESTAMP ) ); registerFunction( "curtime", new StandardJDBCEscapeFunction( "curtime", StandardBasicTypes.TIME ) );
registerFunction( "current_time", new NoArgSQLFunction( "current_time", StandardBasicTypes.TIME, false ) ); registerFunction( "current_timestamp", new ConditionalParenthesisFunction( "current_timestamp", StandardBasicTypes.TIMESTAMP ) ); registerFunction( "curtime", new StandardJDBCEscapeFunction( "curtime", StandardBasicTypes.TIME ) );
public String render(List args, SessionFactoryImplementor factory) { final boolean hasArgs = !args.isEmpty(); StringBuffer buf = new StringBuffer(); buf.append( getName() ); if ( hasArgs ) { buf.append( "(" ); for ( int i = 0; i < args.size(); i++ ) { buf.append( args.get( i ) ); if ( i < args.size() - 1 ) { buf.append( ", " ); } } buf.append( ")" ); } return buf.toString(); } }
registerFunction( "current_time", new NoArgSQLFunction( "current_time", StandardBasicTypes.TIME, false ) ); registerFunction( "current_timestamp", new ConditionalParenthesisFunction( "current_timestamp", StandardBasicTypes.TIMESTAMP ) ); registerFunction( "curtime", new StandardJDBCEscapeFunction( "curtime", StandardBasicTypes.TIME ) );
public String render(List args, SessionFactoryImplementor factory) { final boolean hasArgs = !args.isEmpty(); StringBuffer buf = new StringBuffer(); buf.append( getName() ); if ( hasArgs ) { buf.append( "(" ); for ( int i = 0; i < args.size(); i++ ) { buf.append( args.get( i ) ); if ( i < args.size() - 1 ) { buf.append( ", " ); } } buf.append( ")" ); } return buf.toString(); } }