@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if ( "findColumn".equals( method.getName() ) ) { return findColumn( (String) args[0] ); } if ( isFirstArgColumnLabel( method ) ) { Method columnIndexMethod = NAME_TO_INDEX_METHOD_MAPPING.get( new ResultSetMethodKey( method.getName(), method.getParameterTypes() ) ); if ( columnIndexMethod != null ) { try { final Integer columnIndex = findColumn( (String) args[0] ); return invokeMethod( columnIndexMethod, buildColumnIndexMethodArgs( args, columnIndex ) ); } catch ( SQLException ex ) { final String msg = "Exception getting column index for column: [" + args[0] + "].\nReverting to using: [" + args[0] + "] as first argument for method: [" + method + "]"; SQL_EXCEPTION_HELPER.logExceptions( ex, msg ); } } } return invokeMethod( method, args ); }
@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if ( "findColumn".equals( method.getName() ) ) { return findColumn( (String) args[0] ); } if ( isFirstArgColumnLabel( method ) ) { Method columnIndexMethod = NAME_TO_INDEX_METHOD_MAPPING.get( new ResultSetMethodKey( method.getName(), method.getParameterTypes() ) ); if ( columnIndexMethod != null ) { try { final Integer columnIndex = findColumn( (String) args[0] ); return invokeMethod( columnIndexMethod, buildColumnIndexMethodArgs( args, columnIndex ) ); } catch ( SQLException ex ) { final String msg = "Exception getting column index for column: [" + args[0] + "].\nReverting to using: [" + args[0] + "] as first argument for method: [" + method + "]"; SQL_EXCEPTION_HELPER.logExceptions( ex, msg ); } } } return invokeMethod( method, args ); }
@Override @SuppressWarnings( {"UnnecessaryBoxing"}) public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if ( "findColumn".equals( method.getName() ) ) { return Integer.valueOf( findColumn( ( String ) args[0] ) ); } if ( isFirstArgColumnLabel( method, args ) ) { try { int columnIndex = findColumn( ( String ) args[0] ); return invokeMethod( locateCorrespondingColumnIndexMethod( method ), buildColumnIndexMethodArgs( args, columnIndex ) ); } catch ( SQLException ex ) { StringBuffer buf = new StringBuffer() .append( "Exception getting column index for column: [" ) .append( args[0] ) .append( "].\nReverting to using: [" ) .append( args[0] ) .append( "] as first argument for method: [" ) .append( method ) .append( "]" ); sqlExceptionHelper.logExceptions( ex, buf.toString() ); } catch ( NoSuchMethodException ex ) { LOG.unableToSwitchToMethodUsingColumnIndex( method ); } } return invokeMethod( method, args ); }
@Override @SuppressWarnings( {"UnnecessaryBoxing"}) public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if ( "findColumn".equals( method.getName() ) ) { return Integer.valueOf( findColumn( ( String ) args[0] ) ); } if ( isFirstArgColumnLabel( method, args ) ) { try { int columnIndex = findColumn( ( String ) args[0] ); return invokeMethod( locateCorrespondingColumnIndexMethod( method ), buildColumnIndexMethodArgs( args, columnIndex ) ); } catch ( SQLException ex ) { StringBuffer buf = new StringBuffer() .append( "Exception getting column index for column: [" ) .append( args[0] ) .append( "].\nReverting to using: [" ) .append( args[0] ) .append( "] as first argument for method: [" ) .append( method ) .append( "]" ); sqlExceptionHelper.logExceptions( ex, buf.toString() ); } catch ( NoSuchMethodException ex ) { LOG.unableToSwitchToMethodUsingColumnIndex( method ); } } return invokeMethod( method, args ); }