Pickup additional parameters from Hibernate.

pull/60/head
Brett Wooldridge 11 years ago
parent 2dd9c08a3f
commit e43864f626

@ -42,20 +42,22 @@ public class HikariConfigurationUtil
@SuppressWarnings("rawtypes")
public static HikariConfig loadConfiguration(Map props)
{
Properties hicaryProps = new Properties();
copyProperty(AvailableSettings.ISOLATION, props, "transactionIsolation", hicaryProps);
copyProperty(AvailableSettings.AUTOCOMMIT, props, "autoCommit", hicaryProps);
Properties hikariProps = new Properties();
copyProperty(AvailableSettings.ISOLATION, props, "transactionIsolation", hikariProps);
copyProperty(AvailableSettings.AUTOCOMMIT, props, "autoCommit", hikariProps);
copyProperty(AvailableSettings.DRIVER, props, "driverClassName", hikariProps);
copyProperty(AvailableSettings.URL, props, "jdbcUrl", hikariProps);
for (Object keyo : props.keySet())
{
String key = (String) keyo;
if (key.startsWith(CONFIG_PREFIX))
{
hicaryProps.setProperty(key.substring(CONFIG_PREFIX.length()), (String) props.get(key));
hikariProps.setProperty(key.substring(CONFIG_PREFIX.length()), (String) props.get(key));
}
}
return new HikariConfig(hicaryProps);
return new HikariConfig(hikariProps);
}
@SuppressWarnings("rawtypes")

Loading…
Cancel
Save