Configuration cfg = new Configuration();
cfg.getProperties().clear(); // avoid reading hibernate.properties and Sys-props
// Handle custom listeners....
ListenerInjector listenerInjector = generateListenerInjectorInstance();
if ( listenerInjector != null )
{
listenerInjector.injectListeners( beanName, cfg );
}
// Handle config settings....
transferSettings( cfg.getProperties() );