docs: private static Configuration hibernateConfiguration(Config config)
    {
      int transactionTimeout = config.getProperty("hibernate.transaction.timeout", int.class, 0);
      int min_size = config.getProperty("hibernate.c3p0.min_size", int.class, 0);
      int max_size = config.getProperty("hibernate.c3p0.max_size", int.class, 0);
      int max_statements = config.getProperty("hibernate.c3p0.max_statements", int.class, 0);
  
      // takes care max_size greater than min_size and max_statements greater than max_size
      // otherwise strange behavior occurs on multi-threading, see DatabaseTest#executeConcurentNativeHibernate()
  
      if(max_size > 0 && max_size < 4) {
        max_size = 4;
      }
      if(min_size > 0 && min_size > max_size) {
        min_size = max_size;
      }
      if(max_statements > 0 && max_statements < max_size) {
        max_statements = max_size;
      }
  
      Properties properties = config.getUnusedProperties();
      if(!config.getAttribute("test-session", boolean.class, false)) {
        // do not use C3P0 database connections pool when run tests
        // if tests are executed from Ant script, for speed reason all ran into a single virtual machine
        // every test requiring database connection will acquire connection but do no dispose till virtual machine end
        // leading to connections pool exhaust and test suite halt
        properties.setProperty("hibernate.connection.provider_class", "org.hibernate.connection.C3P0ConnectionProvider");
        properties.setProperty("hibernate.c3p0.idle_test_period", TEST_PERIOD);
        properties.setProperty("hibernate.c3p0.preferredTestQuery", TEST_QUERY);
      }
  
      Configuration configuration = new Configuration();
      configuration.setProperties(properties);
  
      properties.setProperty("hibernate.transaction.timeout", Integer.toString(transactionTimeout));
      if(max_size != 0) {
        configuration.setProperty("hibernate.c3p0.max_size", Integer.toString(max_size));
        properties.setProperty("hibernate.c3p0.max_size", Integer.toString(max_size));
      }
      if(min_size != 0) {
        configuration.setProperty("hibernate.c3p0.min_size", Integer.toString(min_size));
        properties.setProperty("hibernate.c3p0.min_size", Integer.toString(min_size));
      }
      if(max_statements != 0) {
        configuration.setProperty("hibernate.c3p0.max_statements", Integer.toString(max_statements));
        properties.setProperty("hibernate.c3p0.max_statements", Integer.toString(max_statements));
      }
  
      // traverse all packages from <mappings> elements and add mapping files to configuration
      for(Config mappings : config.findChildren("mappings")) {
        String filesPattern = mappings.getAttribute("files-pattern", "*.hbm.xml");
        // missing package attribute is replaced with empty string that is the 'name' of package root
        String packageName = mappings.getAttribute("package", "");
        for(String resource : Classes.listPackageResources(packageName, filesPattern)) {
          configuration.addResource(resource);
        }
      }
  
      return configuration;
    }