While I haven't really solved this problem, I have gotten around it for myself. Maybe this will help someone else.
I am using ant, so what I did was get an XPath ant task and harvest the data I needed from my applicationContext.xml.
You need the Andariel library:
http://andariel.uworks.net/
Code:
<taskdef resource="net/uworks/andariel/andariel.properties">
<classpath>
<pathelement location="andariel-1.2.3.jar" />
</classpath>
</taskdef>
then I wrote a target that makes a propeties file. It creates a property called "temp.propfile" that you can then use in a Configuration section.
Code:
<target name="-make-propfile">
<!-- extract properties from the applicationContext.xml file -->
<xpath file="${src.dir}/applicationContext.xml" expression="/sb:beans/sb:bean[@id='SelboardDataSource']/sb:property[@name='driverClassName']/@value" outputproperty="hibernate.connection.driver_class">
<namespace prefix="sb" uri="http://www.springframework.org/schema/beans"/>
</xpath>
<xpath file="${src.dir}/applicationContext.xml" expression="/sb:beans/sb:bean[@id='SelboardDataSource']/sb:property[@name='url']/@value" outputproperty="hibernate.connection.url">
<namespace prefix="sb" uri="http://www.springframework.org/schema/beans"/>
</xpath>
<xpath file="${src.dir}/applicationContext.xml" expression="/sb:beans/sb:bean[@id='SelboardDataSource']/sb:property[@name='username']/@value" outputproperty="hibernate.connection.username">
<namespace prefix="sb" uri="http://www.springframework.org/schema/beans"/>
</xpath>
<xpath file="${src.dir}/applicationContext.xml" expression="/sb:beans/sb:bean[@id='SelboardDataSource']/sb:property[@name='password']/@value" outputproperty="hibernate.connection.password">
<namespace prefix="sb" uri="http://www.springframework.org/schema/beans"/>
</xpath>
<xpath backwardscompatible="true" file="${src.dir}/applicationContext.xml" expression="//sb:prop[@key='hibernate.dialect']/text()" outputproperty="hibernate.dialect">
<namespace prefix="f" uri="http://www.w3.org/2005/02/xpath-functions"/>
<namespace prefix="sb" uri="http://www.springframework.org/schema/beans"/>
</xpath>
<trim name="hibernate.dialect"/>
<property name="tmpdir" location="${rev-eng.dir}/${temporary.properties.dir}"/>
<mkdir dir="${tmpdir}" />
<tempfile property="temp.propfile" prefix="jdbc-reverse-eng-" suffix=".properties" destdir="${tmpdir}"/>
<echo>writing out stuff to file '${temp.propfile}'</echo>
<echo file="${temp.propfile}">
hibernate.connection.driver_class=${hibernate.connection.driver_class}
hibernate.connection.url=${hibernate.connection.url}
hibernate.connection.username=${hibernate.connection.username}
hibernate.connection.password=${hibernate.connection.password}
hibernate.dialect=${hibernate.dialect}
hibernate.connection.aggressive_release=false
hibernate.connection.release_mode=after_transaction
hibernate.connection.autocommit=true
hibernate.connection.pool_size=0
hibernate.current_session_context_class=thread
hibernate.cache.use_query_cache=false
hibernate.cache.use_second_level_cache=false
</echo>
</target>