org.hibernate.cfg.Configuration should obey standard java.util.Properties overwrite rules

Description

Standard Java properties operate under the principal of "first come first served". Once a property has a value it is not changed by a later attempt.

The method org.hibernate.cfg.Configuration.addProperties(Element parent) should read

private void addProperties(Element parent) {
Iterator iter = parent.elementIterator( "property" );
while ( iter.hasNext() ) {
Element node = (Element) iter.next();
String name = node.attributeValue( "name" );
String value = node.getText().trim();
log.debug( name + "=" + value );
if (properties.containsKey(name)
continue;
properties.setProperty( name, value );
if ( !name.startsWith( "hibernate" ) ) {
properties.setProperty( "hibernate." + name, value );
}
}
Environment.verifyProperties( properties );
}

Activity

Steve EbersoleMarch 21, 2011 at 6:59 PM

Closing stale resolved issues

Emmanuel BernardApril 19, 2006 at 3:57 AM

We cannot break all the Hibernate applications outthere. Plus it allows programmatic overriding over file configuration

Rejected

Details

Assignee

Reporter

Original estimate

Time tracking

No time logged0.03h remaining

Components

Priority

Created April 19, 2006 at 3:46 AM
Updated March 21, 2011 at 6:59 PM
Resolved April 19, 2006 at 3:57 AM