public static String generateCQLStatementForInsert(Index index){
  String iTableToUpdate=Utils.calculateITableName(index);
  List<String> fields=index.getFieldsValues();
  String fieldNamesInsertSyntax=Utils.join(", ",fields);
  StringBuilder fieldValueInsertSyntax=new StringBuilder();
  for (int i=0; i < fields.size(); i++) {
    if (i != 0) {
      fieldValueInsertSyntax.append(", ");
    }
    fieldValueInsertSyntax.append("?");
  }
  return String.format(ITABLE_INSERT_CQL,iTableToUpdate,fieldNamesInsertSyntax,fieldValueInsertSyntax);
}

public static String generateCQLStatementForInsert ( Index index ) { String iTableToUpdate = Utils . calculateITableName ( index ) ; List < String > fields = index . getFieldsValues ( ) ; String fieldNamesInsertSyntax = Utils . join ( ", " , fields ) ; StringBuilder fieldValueInsertSyntax = new StringBuilder ( ) ; for ( int i = 0 ; i < fields . size ( ) ; i ++ ) { if ( i != 0 ) { fieldValueInsertSyntax . append ( ", " ) ; } fieldValueInsertSyntax . append ( "?" ) ; } return String . format ( ITABLE_INSERT_CQL , iTableToUpdate , fieldNamesInsertSyntax , fieldValueInsertSyntax ) ; }
helper for generating insert cql statements for itables . this would be private but keeping public for ease of testing .
