Author: steve.ebersole(a)jboss.com
Date: 2010-01-18 22:09:22 -0500 (Mon, 18 Jan 2010)
New Revision: 18578
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/Ejb3Configuration.java
Log:
HHH-4669 - Implement JDBC driver properties support
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/Ejb3Configuration.java
===================================================================
---
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/Ejb3Configuration.java 2010-01-18
22:05:16 UTC (rev 18577)
+++
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/Ejb3Configuration.java 2010-01-19
03:09:22 UTC (rev 18578)
@@ -187,6 +187,24 @@
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() );
Show replies by date