private String inClause ( String field , Set < String > values ) { String separator = "" ; StringBuffer sb = new StringBuffer ( " and (" ) ; for ( String v : values ) { sb . append ( separator ) ; sb . append ( String . format ( "%s = '%s'" , field , v ) ) ; separator = " or " ; } sb . append ( ")" ) ; return sb . toString ( ) ; }
An exploded in clause because the actual one seems not to work