private String convertFieldValue ( final Field field , final ExportContainer container ) { final boolean isArray2D = ( container . getType ( ) == FieldContainer . Type . ARRAY_2D ) ; if ( field . getType ( ) . equals ( String . class ) ) { return wrapWithComma ( container . getExportValue ( ) ) ; } else if ( isTypeTimestampConvertible ( field ) ) { return wrapWithComma ( String . valueOf ( convertFieldValueToTimestamp ( field , container ) ) ) ; } else if ( container . getType ( ) == FieldContainer . Type . ARRAY || isArray2D || container . getType ( ) == FieldContainer . Type . COLLECTION ) { final Class < ? > componentType = extractType ( container . getType ( ) , field ) ; final String sqlType = dataTypes . getOrDefault ( componentType , "VARCHAR" ) ; final String result = ( sqlType . equals ( "VARCHAR" ) || sqlType . equals ( "CHAR" ) ) ? container . getExportValue ( ) . replace ( "[" , "{\"" ) . replace ( "]" , "\"}" ) . replace ( "," , "\",\"" ) . replace ( " " , "" ) : container . getExportValue ( ) . replace ( "[" , "{" ) . replace ( "]" , "}" ) ; return wrapWithComma ( result ) ; } return container . getExportValue ( ) ; }
Convert container value to Sql specific value type