[hibernate-commits] Hibernate SVN: r21125 - core/patches/hibernate-3.3.2.GA_CP04_JBPAPP-10707/core/src/main/java/org/hibernate/connection.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Wed May 29 10:37:31 EDT 2013


Author: brmeyer
Date: 2013-05-29 10:37:31 -0400 (Wed, 29 May 2013)
New Revision: 21125

Modified:
   core/patches/hibernate-3.3.2.GA_CP04_JBPAPP-10707/core/src/main/java/org/hibernate/connection/ConnectionProviderFactory.java
Log:
HHH-8226 table synonyms cannot find columns on Oracle

Modified: core/patches/hibernate-3.3.2.GA_CP04_JBPAPP-10707/core/src/main/java/org/hibernate/connection/ConnectionProviderFactory.java
===================================================================
--- core/patches/hibernate-3.3.2.GA_CP04_JBPAPP-10707/core/src/main/java/org/hibernate/connection/ConnectionProviderFactory.java	2013-05-29 14:36:36 UTC (rev 21124)
+++ core/patches/hibernate-3.3.2.GA_CP04_JBPAPP-10707/core/src/main/java/org/hibernate/connection/ConnectionProviderFactory.java	2013-05-29 14:37:31 UTC (rev 21125)
@@ -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" );
 	}
 
 }



More information about the hibernate-commits mailing list