<commit_before>package com.kiselev.dataframework.mapper.processor.impl;

import com.kiselev.dataframework.mapper.annotation.Column;
import com.kiselev.dataframework.mapper.annotation.Table;
import com.kiselev.dataframework.mapper.exception.mapping.ClassMappingException;
import com.kiselev.dataframework.mapper.processor.api.SQLMapper;
import com.sun.deploy.util.StringUtils;

import java.lang.reflect.Field;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

/**
 * @author <NAME>
 * @version 1.0
 * @since 02/11/2017
 */

public class SQLQueryMapper implements SQLMapper {

    @Override
    public <Entity> String map(Entity entity) {
        final String QUERY_PATTERN = "INSERT INTO %s (%s) VALUES (%s);";
        Class<?> clazz = entity.getClass();

        Table table = clazz.getAnnotation(Table.class);
        if (table != null) {
            String tableName = table.tableName();
            String columns = StringUtils.join(getColumnsFromEntity(entity), ", ");<commit_msg>Fix string joining in sql mapper<commit_after>package com.kiselev.dataframework.mapper.processor.impl;

import com.kiselev.dataframework.mapper.annotation.Column;
import com.kiselev.dataframework.mapper.annotation.Table;
import com.kiselev.dataframework.mapper.exception.mapping.ClassMappingException;
import com.kiselev.dataframework.mapper.processor.api.SQLMapper;
import org.apache.commons.lang3.StringUtils;

import java.lang.reflect.Field;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

/**
 * @author <NAME>
 * @version 1.0
 * @since 02/11/2017
 */

public class SQLQueryMapper implements SQLMapper {

    @Override
    public <Entity> String map(Entity entity) {
        final String QUERY_PATTERN = "INSERT INTO %s (%s) VALUES (%s);";
        Class<?> clazz = entity.getClass();

        Table table = clazz.getAnnotation(Table.class);
        if (table != null) {
            String tableName = table.tableName();
            String columns = StringUtils.join(getColumnsFromEntity(entity), ", ");
{'fraction_non_alphanumeric': 0.12, 'fraction_numerical': 0.01024390243902439, 'mean_word_length': 4.051724137931035, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2503328', 'n_tokens_mistral': 631, 'n_tokens_neox': 607, 'n_words': 127}