protected void persistJoinTableByCql(JoinTableData joinTableData, Cassandra.Client conn) {
        String joinTableName = joinTableData.getJoinTableName();
        String invJoinColumnName = joinTableData.getInverseJoinColumnName();
        Map<Object, Set<Object>> joinTableRecords = joinTableData.getJoinTableRecords();

        EntityMetadata entityMetadata =
            KunderaMetadataManager.getEntityMetadata(kunderaMetadata, joinTableData.getEntityClass());

        // need to bring in an insert query for this
        // add columns & execute query
        CQLTranslator translator = new CQLTranslator();

        String batch_Query = CQLTranslator.BATCH_QUERY;

        String insert_Query = translator.INSERT_QUERY;

        StringBuilder builder = new StringBuilder();
        builder.append(CQLTranslator.DEFAULT_KEY_NAME);
        builder.append(CQLTranslator.COMMA_STR);
        builder.append(translator.ensureCase(new StringBuilder(), joinTableData.getJoinColumnName(), false));
        builder.append(CQLTranslator.COMMA_STR);
        builder.append(translator.ensureCase(new StringBuilder(), joinTableData.getInverseJoinColumnName(), false));

        insert_Query = StringUtils.replace(insert_Query, CQLTranslator.COLUMN_FAMILY,
            translator.ensureCase(new StringBuilder(), joinTableName, false).toString());

        insert_Query = StringUtils.replace(insert_Query, CQLTranslator.COLUMNS, builder.toString());

        StringBuilder columnValueBuilder = new StringBuilder();

        StringBuilder statements = new StringBuilder();

        // insert query for each row key

        for (Object key : joinTableRecords.keySet()) {
            PropertyAccessor accessor =
                PropertyAccessorFactory.getPropertyAccessor((Field) entityMetadata.getIdAttribute().getJavaMember());

            Set<Object> values = joinTableRecords.get(key); // join column value

            for (Object value : values) {
                if (value != null) {
                    String insertQuery = insert_Query;
                    columnValueBuilder.append(CQLTranslator.QUOTE_STR);
                    columnValueBuilder.append(
                        PropertyAccessorHelper.getString(key) + "\001" + PropertyAccessorHelper.getString(value));
                    columnValueBuilder.append(CQLTranslator.QUOTE_STR);
                    columnValueBuilder.append(CQLTranslator.COMMA_STR);
                    translator.appendValue(columnValueBuilder, key.getClass(), key, true, false);
                    columnValueBuilder.append(CQLTranslator.COMMA_STR);
                    translator.appendValue(columnValueBuilder, value.getClass(), value, true, false);

                    insertQuery =
                        StringUtils.replace(insertQuery, CQLTranslator.COLUMN_VALUES, columnValueBuilder.toString());
                    statements.append(insertQuery);
                    statements.append(" ");
                }
            }
        }

        if (!StringUtils.isBlank(statements.toString())) {
            batch_Query = StringUtils.replace(batch_Query, CQLTranslator.STATEMENT, statements.toString());
            StringBuilder batchBuilder = new StringBuilder();
            batchBuilder.append(batch_Query);
            batchBuilder.append(CQLTranslator.APPLY_BATCH);
            execute(batchBuilder.toString(), conn);
        }

    }
protected void persistJoinTableByCql ( JoinTableData joinTableData , Cassandra . Client conn ) { String joinTableName = joinTableData . getJoinTableName ( ) ; String invJoinColumnName = joinTableData . getInverseJoinColumnName ( ) ; Map < Object , Set < Object > > joinTableRecords = joinTableData . getJoinTableRecords ( ) ; EntityMetadata entityMetadata = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , joinTableData . getEntityClass ( ) ) ; CQLTranslator translator = new CQLTranslator ( ) ; String batch_Query = CQLTranslator . BATCH_QUERY ; String insert_Query = translator . INSERT_QUERY ; StringBuilder builder = new StringBuilder ( ) ; builder . append ( CQLTranslator . DEFAULT_KEY_NAME ) ; builder . append ( CQLTranslator . COMMA_STR ) ; builder . append ( translator . ensureCase ( new StringBuilder ( ) , joinTableData . getJoinColumnName ( ) , false ) ) ; builder . append ( CQLTranslator . COMMA_STR ) ; builder . append ( translator . ensureCase ( new StringBuilder ( ) , joinTableData . getInverseJoinColumnName ( ) , false ) ) ; insert_Query = StringUtils . replace ( insert_Query , CQLTranslator . COLUMN_FAMILY , translator . ensureCase ( new StringBuilder ( ) , joinTableName , false ) . toString ( ) ) ; insert_Query = StringUtils . replace ( insert_Query , CQLTranslator . COLUMNS , builder . toString ( ) ) ; StringBuilder columnValueBuilder = new StringBuilder ( ) ; StringBuilder statements = new StringBuilder ( ) ; for ( Object key : joinTableRecords . keySet ( ) ) { PropertyAccessor accessor = PropertyAccessorFactory . getPropertyAccessor ( ( Field ) entityMetadata . getIdAttribute ( ) . getJavaMember ( ) ) ; Set < Object > values = joinTableRecords . get ( key ) ; for ( Object value : values ) { if ( value != null ) { String insertQuery = insert_Query ; columnValueBuilder . append ( CQLTranslator . QUOTE_STR ) ; columnValueBuilder . append ( PropertyAccessorHelper . getString ( key ) + "\001" + PropertyAccessorHelper . getString ( value ) ) ; columnValueBuilder . append ( CQLTranslator . QUOTE_STR ) ; columnValueBuilder . append ( CQLTranslator . COMMA_STR ) ; translator . appendValue ( columnValueBuilder , key . getClass ( ) , key , true , false ) ; columnValueBuilder . append ( CQLTranslator . COMMA_STR ) ; translator . appendValue ( columnValueBuilder , value . getClass ( ) , value , true , false ) ; insertQuery = StringUtils . replace ( insertQuery , CQLTranslator . COLUMN_VALUES , columnValueBuilder . toString ( ) ) ; statements . append ( insertQuery ) ; statements . append ( " " ) ; } } } if ( ! StringUtils . isBlank ( statements . toString ( ) ) ) { batch_Query = StringUtils . replace ( batch_Query , CQLTranslator . STATEMENT , statements . toString ( ) ) ; StringBuilder batchBuilder = new StringBuilder ( ) ; batchBuilder . append ( batch_Query ) ; batchBuilder . append ( CQLTranslator . APPLY_BATCH ) ; execute ( batchBuilder . toString ( ) , conn ) ; } }
Persist join table by cql.

@param joinTableData
the join table data
@param conn
the conn