<commit_before>package com.reizes.shiva2.jdbc.loader;

import java.util.Map;
import java.util.Properties;

import javax.sql.DataSource;

import com.reizes.shiva2.utils.StringUtil;

public class MapLoader extends AbstractJDBCLoader {
	private boolean useCamel = false;

	public MapLoader() {
		super();
	}

	public MapLoader(DataSource datasource) {
		super(datasource);
	}

	public MapLoader(Map<String, Object> datasourceProperties) throws Exception {
		super(datasourceProperties);
	}

	public MapLoader(Properties prop) throws Exception {
		super(prop);
	}

	@SuppressWarnings("unchecked")
	@Override
	protected Object getData(Object object, String name) {
		Map<String, Object> map = (Map<String, Object>)object;
		String key = name.toLowerCase();
		
		if (useCamel) {
			key = StringUtil.camelize(key);
		}
		
		return map.get(key);
	}

	public boolean isUseCamel() {
		return useCamel;
	}

	public void setUseCamel(boolean useCamel) {
		this.useCamel = useCamel;
	}

}<commit_msg>shiva2-jdbc : add method to convert column name to lower case<commit_after>package com.reizes.shiva2.jdbc.loader;

import java.util.Map;
import java.util.Properties;

import javax.sql.DataSource;

import com.reizes.shiva2.utils.StringUtil;

public class MapLoader extends AbstractJDBCLoader {
	private boolean useCamel = false;
	private boolean lowerCase = true;

	public MapLoader() {
		super();
	}

	public MapLoader(DataSource datasource) {
		super(datasource);
	}

	public MapLoader(Map<String, Object> datasourceProperties) throws Exception {
		super(datasourceProperties);
	}

	public MapLoader(Properties prop) throws Exception {
		super(prop);
	}

	@SuppressWarnings("unchecked")
	@Override
	protected Object getData(Object object, String name) {
		Map<String, Object> map = (Map<String, Object>)object;
		
		String key = lowerCase?name.toLowerCase():name;
		
		if (useCamel) {
			key = StringUtil.camelize(key);
		}
		
		return map.get(key);
	}

	public boolean isUseCamel() {
		return useCamel;
	}

	public void setUseCamel(boolean useCamel) {
		this.useCamel = useCamel;
	}

	public boolean isLowerCase() {
		return lowerCase;
	}

	public void setLowerCase(boolean lowerCase) {
		this.lowerCase = lowerCase;
	}

}
{'fraction_non_alphanumeric': 0.10588235294117647, 'fraction_numerical': 0.0022624434389140274, 'mean_word_length': 4.64030612244898, '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': '3230200', 'n_tokens_mistral': 781, 'n_tokens_neox': 719, 'n_words': 168}