private String processSqlParams ( Object value ) { Object [ ] arr = null ; if ( value != null ) { arr = TypeMappingsFactory . toObjectArray ( value ) ; } if ( value == null || ( arr != null && arr . length == 0 ) ) { return "" ; } else if ( arr != null ) { StringBuilder result = new StringBuilder ( ) ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( i > 0 ) { result . append ( ' ' ) ; result . append ( arr [ i ] . toString ( ) ) ; } else { result . append ( arr [ i ] . toString ( ) ) ; } } return result . toString ( ) ; } else { return value . toString ( ) ; } }
Check for the cases of a null or array type param value . If array type build a string of the array values seperated by commas .