Search in sources :

Example 6 with H2Dialect

use of org.hibernate.dialect.H2Dialect in project hibernate-orm by hibernate.

the class BaseEnversJPAFunctionalTestCase method buildSettings.

private Map buildSettings() {
    Map settings = getConfig();
    addMappings(settings);
    if (createSchema()) {
        settings.put(org.hibernate.cfg.AvailableSettings.HBM2DDL_AUTO, "create-drop");
        final String secondSchemaName = createSecondSchema();
        if (StringHelper.isNotEmpty(secondSchemaName)) {
            if (!(getDialect() instanceof H2Dialect)) {
                throw new UnsupportedOperationException("Only H2 dialect supports creation of second schema.");
            }
            Helper.createH2Schema(secondSchemaName, settings);
        }
    }
    if (StringHelper.isNotEmpty(getAuditStrategy())) {
        settings.put(EnversSettings.AUDIT_STRATEGY, getAuditStrategy());
    }
    if (!autoRegisterListeners()) {
        settings.put(EnversIntegrator.AUTO_REGISTER, "false");
    }
    settings.put(EnversSettings.USE_REVISION_ENTITY_WITH_NATIVE_ID, "false");
    settings.put(org.hibernate.cfg.AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true");
    settings.put(org.hibernate.cfg.AvailableSettings.DIALECT, getDialect().getClass().getName());
    return settings;
}
Also used : H2Dialect(org.hibernate.dialect.H2Dialect) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

H2Dialect (org.hibernate.dialect.H2Dialect)6 StandardServiceRegistryBuilder (org.hibernate.boot.registry.StandardServiceRegistryBuilder)3 StandardServiceRegistryImpl (org.hibernate.boot.registry.internal.StandardServiceRegistryImpl)3 DriverManagerConnectionProviderImpl (org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl)3 ConnectionProviderJdbcConnectionAccess (org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.ConnectionProviderJdbcConnectionAccess)3 JdbcServices (org.hibernate.engine.jdbc.spi.JdbcServices)3 Test (org.junit.Test)3 Properties (java.util.Properties)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Configuration (org.hibernate.cfg.Configuration)1 CUBRIDDialect (org.hibernate.dialect.CUBRIDDialect)1 DB2400Dialect (org.hibernate.dialect.DB2400Dialect)1 DB2Dialect (org.hibernate.dialect.DB2Dialect)1 DerbyDialect (org.hibernate.dialect.DerbyDialect)1 DerbyTenFiveDialect (org.hibernate.dialect.DerbyTenFiveDialect)1 DerbyTenSevenDialect (org.hibernate.dialect.DerbyTenSevenDialect)1 DerbyTenSixDialect (org.hibernate.dialect.DerbyTenSixDialect)1 FirebirdDialect (org.hibernate.dialect.FirebirdDialect)1 HANAColumnStoreDialect (org.hibernate.dialect.HANAColumnStoreDialect)1