<commit_before>package org.schooldesk.dao.hibernateimpl;

import java.util.*;

import org.hibernate.*;
import org.schooldesk.dao.*;


public class HibernateDaoFactory extends DaoFactory implements IDaoFactory {
	private Map<Class<? extends IDao<?>>, IDao<?>> daoPool = new HashMap<>();
	private SessionFactory sessionFactory;

	public HibernateDaoFactory(String login, String password, String connectionURL) {
		sessionFactory = HibernateConfiguration.buildSessionFactory(login, password, connectionURL);
	}<commit_msg>#7, 20 Конфигурация DaoFactory осуществляется через файл<commit_after>package org.schooldesk.dao.hibernateimpl;

import java.io.*;
import java.util.*;

import org.hibernate.*;
import org.schooldesk.dao.*;


public class HibernateDaoFactory extends DaoFactory implements IDaoFactory {
	private static final String CONFIG_FILE = "dao.factory.config";

	private Map<Class<? extends IDao<?>>, IDao<?>> daoPool = new HashMap<>();
	private SessionFactory sessionFactory;

	public HibernateDaoFactory() throws IOException {
		Properties configuration = getFactoryConfiguration();
		sessionFactory = HibernateConfiguration.buildSessionFactory(
				configuration.getProperty("db_login"),
				configuration.getProperty("db_password"),
				configuration.getProperty("db_connection")
		);
	}

	private Properties getFactoryConfiguration() throws IOException {
		Properties configuration = new Properties();
		try (InputStream is = new BufferedInputStream(new FileInputStream(CONFIG_FILE))) {
			configuration.load(is);
		}
		return configuration;
	}
{'fraction_non_alphanumeric': 0.10089974293059126, 'fraction_numerical': 0.0019280205655526992, 'mean_word_length': 6.44976076555024, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2373881', 'n_tokens_mistral': 446, 'n_tokens_neox': 419, 'n_words': 107}