Hibernate SVN: r21115 - core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/connection.
by hibernate-commits@lists.jboss.org
Author: brmeyer
Date: 2013-05-07 16:28:35 -0400 (Tue, 07 May 2013)
New Revision: 21115
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/connection/ConnectionProviderFactory.java
Log:
HHH-8226 table synonyms cannot find columns on Oracle
Modified: core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/connection/ConnectionProviderFactory.java
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/connection/ConnectionProviderFactory.java 2013-05-03 18:10:35 UTC (rev 21114)
+++ core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/connection/ConnectionProviderFactory.java 2013-05-07 20:28:35 UTC (rev 21115)
@@ -30,6 +30,7 @@
import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
@@ -172,6 +173,9 @@
properties.getProperty(prop)
);
}
+ else if ( CONDITIONAL_PROPERTIES.containsKey( prop ) ) {
+ result.setProperty( CONDITIONAL_PROPERTIES.get( prop ), properties.getProperty(prop) );
+ }
}
String userName = properties.getProperty(Environment.USER);
if (userName!=null) result.setProperty( "user", userName );
@@ -188,7 +192,17 @@
SPECIAL_PROPERTIES.add(Environment.ISOLATION);
SPECIAL_PROPERTIES.add(Environment.DRIVER);
SPECIAL_PROPERTIES.add(Environment.USER);
+ }
+ // Connection properties (map value) that automatically need set if the
+ // Hibernate property (map key) is available. Makes the assumption that
+ // both settings use the same value type.
+ private static final Map<String, String> CONDITIONAL_PROPERTIES;
+
+ static {
+ CONDITIONAL_PROPERTIES = new HashMap<String, String>();
+ // Oracle requires that includeSynonyms=true in order for getColumns to work using a table synonym name.
+ CONDITIONAL_PROPERTIES.put( Environment.ENABLE_SYNONYMS, "includeSynonyms" );
}
}