HHH-4669 - Implement JDBC driver properties support

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18578 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Steve Ebersole 2010-01-19 03:09:22 +00:00
parent 6eb54445aa
commit e474a00c4a
1 changed files with 18 additions and 0 deletions

View File

@ -187,6 +187,24 @@ public class Ejb3Configuration implements Serializable, Referenceable {
else if ( StringHelper.isNotEmpty( metadata.getNonJtaDatasource() ) ) {
this.setProperty( Environment.DATASOURCE, metadata.getNonJtaDatasource() );
}
else {
final String driver = (String) metadata.getProps().get( AvailableSettings.JDBC_DRIVER );
if ( StringHelper.isNotEmpty( driver ) ) {
this.setProperty( Environment.DRIVER, driver );
}
final String url = (String) metadata.getProps().get( AvailableSettings.JDBC_URL );
if ( StringHelper.isNotEmpty( url ) ) {
this.setProperty( Environment.URL, url );
}
final String user = (String) metadata.getProps().get( AvailableSettings.JDBC_USER );
if ( StringHelper.isNotEmpty( user ) ) {
this.setProperty( Environment.USER, user );
}
final String pass = (String) metadata.getProps().get( AvailableSettings.JDBC_PASSWORD );
if ( StringHelper.isNotEmpty( pass ) ) {
this.setProperty( Environment.PASS, pass );
}
}
defineTransactionType( metadata.getTransactionType(), workingVars );
if ( metadata.getClasses().size() > 0 ) {
workingVars.put( AvailableSettings.CLASS_NAMES, metadata.getClasses() );