@Override public String render(Type firstArgument, List args, SessionFactoryImplementor factory) throws QueryException { final Options options = new Options(); final String trimSource; final String firstArg = (String) args.get( 0 ); if ( "leading".equalsIgnoreCase( firstArg ) ) { options.setTrimSpecification( Specification.LEADING ); options.setTrimSpecification( Specification.TRAILING ); options.setTrimCharacter( potentialTrimCharacter ); if ( "from".equalsIgnoreCase( (String) args.get( potentialTrimCharacterArgIndex + 1 ) ) ) { trimSource = (String) args.get( potentialTrimCharacterArgIndex + 2 );
protected String render(Options options, String trimSource, SessionFactoryImplementor factory) { return String.format( "trim(%s %s from %s)", options.getTrimSpecification().getName(), options.getTrimCharacter(), trimSource ); } }
public String render(Type firstArgument, List args, SessionFactoryImplementor factory) throws QueryException { final Options options = new Options(); final String trimSource; String firstArg = ( String ) args.get( 0 ); if ( "leading".equalsIgnoreCase( firstArg ) ) { options.setTrimSpecification( Specification.LEADING ); options.setTrimSpecification( Specification.TRAILING ); options.setTrimCharacter( potentialTrimCharacter ); if ( "from".equalsIgnoreCase( ( String ) args.get( potentialTrimCharacterArgIndex + 1 ) ) ) { trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 2 );
public String render(Type firstArgument, List args, SessionFactoryImplementor factory) throws QueryException { final Options options = new Options(); final String trimSource; String firstArg = ( String ) args.get( 0 ); if ( "leading".equalsIgnoreCase( firstArg ) ) { options.setTrimSpecification( Specification.LEADING ); options.setTrimSpecification( Specification.TRAILING ); options.setTrimCharacter( potentialTrimCharacter ); if ( "from".equalsIgnoreCase( ( String ) args.get( potentialTrimCharacterArgIndex + 1 ) ) ) { trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 2 );
protected String render(Options options, String trimSource, SessionFactoryImplementor factory) { return new StringBuffer() .append( "trim(" ) .append( options.getTrimSpecification().getName() ) .append( ' ' ) .append( options.getTrimCharacter() ) .append( " from " ) .append( trimSource ) .append( ')' ) .toString(); } }
protected String render(Options options, String trimSource, SessionFactoryImplementor factory) { return new StringBuffer() .append( "trim(" ) .append( options.getTrimSpecification().getName() ) .append( ' ' ) .append( options.getTrimCharacter() ) .append( " from " ) .append( trimSource ) .append( ')' ) .toString(); } }