Skip to content

Commit 66c15d3

Browse files
committed
HHH-8226
1 parent 17c6204 commit 66c15d3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

hibernate-core/src/main/java/org/hibernate/service/jdbc/connections/internal/ConnectionProviderInitiator.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ public static Properties getConnectionProperties(Map<?,?> properties) {
266266
);
267267
}
268268
}
269+
else if ( CONDITIONAL_PROPERTIES.containsKey( key ) ) {
270+
result.setProperty( CONDITIONAL_PROPERTIES.get( key ), value );
271+
}
269272
}
270273
return result;
271274
}
@@ -281,6 +284,16 @@ public static Properties getConnectionProperties(Map<?,?> properties) {
281284
SPECIAL_PROPERTIES.add( Environment.ISOLATION );
282285
SPECIAL_PROPERTIES.add( Environment.DRIVER );
283286
SPECIAL_PROPERTIES.add( Environment.USER );
287+
}
284288

289+
// Connection properties (map value) that automatically need set if the
290+
// Hibernate property (map key) is available. Makes the assumption that
291+
// both settings use the same value type.
292+
private static final Map<String, String> CONDITIONAL_PROPERTIES;
293+
294+
static {
295+
CONDITIONAL_PROPERTIES = new HashMap<String, String>();
296+
// Oracle requires that includeSynonyms=true in order for getColumns to work using a table synonym name.
297+
CONDITIONAL_PROPERTIES.put( Environment.ENABLE_SYNONYMS, "includeSynonyms" );
285298
}
286299
}

0 commit comments

Comments
 (0)