[jOOQ/jOOQ#9274] AttributeConverterExtractor should receive custom Hibernate configuration properties
This commit is contained in:
parent
0fc3367c20
commit
b238b1e0e5
@ -165,6 +165,7 @@ final class AttributeConverterExtractor implements Integrator {
|
||||
Properties properties = new Properties();
|
||||
properties.put("hibernate.dialect", JPADatabase.HIBERNATE_DIALECT);
|
||||
properties.put("hibernate.hbm2ddl.auto", "create-drop");
|
||||
properties.putAll(database.userSettings);
|
||||
return properties;
|
||||
}
|
||||
|
||||
|
||||
@ -46,6 +46,7 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@ -102,8 +103,9 @@ public class JPADatabase extends H2Database {
|
||||
static final String HIBERNATE_DIALECT = SQLDialect.H2.thirdParty().hibernateDialect();
|
||||
static final JooqLogger log = JooqLogger.getLogger(JPADatabase.class);
|
||||
|
||||
private Connection connection;
|
||||
private boolean publicIsDefault;
|
||||
Connection connection;
|
||||
boolean publicIsDefault;
|
||||
Map<String, Object> userSettings = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
@ -149,8 +151,9 @@ public class JPADatabase extends H2Database {
|
||||
String key = "" + entry.getKey();
|
||||
|
||||
if (key.startsWith("hibernate.") || key.startsWith("javax.persistence."))
|
||||
settings.put(key, entry.getValue());
|
||||
userSettings.put(key, entry.getValue());
|
||||
}
|
||||
settings.putAll(userSettings);
|
||||
|
||||
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
|
||||
builder.applySettings(settings);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user