Configuration object and org.hibernate.cfg.Environment have lots of methods like
..... (lots of other ones)
which all manipulate java.util.Properties as it was only a Map (calls to putAll methods with properties as argument, calls to entrySet(), etc). This is very wrong, as a java.util.Properties is more than a map. Calling map related method only access the first level of the properties. It does not take into account the default value stored in a delegate Properties.
Properties generic = new Properties();
Properties specific = new Properties(generic);
System.out.println(specific.getProperty("hibernate.connection.url")); // printout jdbcostgresql://localhost/mydatabase
Configuration c = new Configuration().configure(urlWithMyMappings).addProperties(specific);
A unit test should be easy to derivate from this example code + existing hibernate unit tests (if those exist)
Now, when you use that configuration, you will notice Hibernate does not see the hibernate.connection.driver_class and hibernate.connection.url properties, poping out exceptions at will, while it's not documented anywhere to not use the form new Properties(defaultProperties).
Either don't use the map/collection related methods of java.util.Properties, instead use the propertyNames() Enumeration when the content of a Properties object has to be analyzed! (Remove all calls like properties.putAll(), properties.keySet(), properties.entrySet())
Either change the Configuration interface to take a Map and not a java.util.Properties as all code in Configuration and related classes consider it a s a simple Map
Does not matter (Hibernate 3, even cvs has the bug)