Java Code Examples for org.hibernate.dialect.H2Dialect

The following examples show how to use org.hibernate.dialect.H2Dialect. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: spring-analysis-note   Source File: HibernateJpaVendorAdapter.java    License: MIT License 6 votes vote down vote up
/**
 * Determine the Hibernate database dialect class for the given target database.
 * @param database the target database
 * @return the Hibernate database dialect class, or {@code null} if none found
 */
@Nullable
protected Class<?> determineDatabaseDialectClass(Database database) {
	switch (database) {
		case DB2: return DB2Dialect.class;
		case DERBY: return DerbyTenSevenDialect.class;
		case H2: return H2Dialect.class;
		case HANA: return HANAColumnStoreDialect.class;
		case HSQL: return HSQLDialect.class;
		case INFORMIX: return InformixDialect.class;
		case MYSQL: return MySQL5Dialect.class;
		case ORACLE: return Oracle12cDialect.class;
		case POSTGRESQL: return PostgreSQL95Dialect.class;
		case SQL_SERVER: return SQLServer2012Dialect.class;
		case SYBASE: return SybaseDialect.class;
		default: return null;
	}
}
 
Example 2
protected Configuration constructConfiguration() {
  Configuration configuration = new Configuration();
  configuration.setProperty( AvailableSettings.CACHE_REGION_FACTORY, CachingRegionFactory.class.getName() );
  configuration.setProperty( AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true" );
  if ( createSchema() ) {
    configuration.setProperty( Environment.HBM2DDL_AUTO, "update" );
    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, configuration );
    }
  }
  configuration.setImplicitNamingStrategy( ImplicitNamingStrategyLegacyJpaImpl.INSTANCE );
  configuration.setProperty( Environment.DIALECT, getDialect().getClass().getName() );
  return configuration;
}
 
Example 3
Source Project: java-technology-stack   Source File: HibernateJpaVendorAdapter.java    License: MIT License 6 votes vote down vote up
/**
 * Determine the Hibernate database dialect class for the given target database.
 * @param database the target database
 * @return the Hibernate database dialect class, or {@code null} if none found
 */
@Nullable
protected Class<?> determineDatabaseDialectClass(Database database) {
	switch (database) {
		case DB2: return DB2Dialect.class;
		case DERBY: return DerbyTenSevenDialect.class;
		case H2: return H2Dialect.class;
		case HANA: return HANAColumnStoreDialect.class;
		case HSQL: return HSQLDialect.class;
		case INFORMIX: return InformixDialect.class;
		case MYSQL: return MySQL5Dialect.class;
		case ORACLE: return Oracle12cDialect.class;
		case POSTGRESQL: return PostgreSQL95Dialect.class;
		case SQL_SERVER: return SQLServer2012Dialect.class;
		case SYBASE: return SybaseDialect.class;
		default: return null;
	}
}
 
Example 4
@Override
public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext)
        throws ParameterResolutionException {

    Configuration config = new Configuration();

    Class<?> declaringClass = parameterContext.getDeclaringExecutable().getDeclaringClass();
    WithHibernateSession annotation = getAnnotation(declaringClass);
    for (Class<?> modelClass : annotation.models()) {
        config.addAnnotatedClass(modelClass);
    }

    config.setProperty(DIALECT, H2Dialect.class.getName());
    config.setProperty(DRIVER, Driver.class.getName());
    config.setProperty(URL, "jdbc:h2:mem:./" + UUID.randomUUID().toString());
    config.setProperty(HBM2DDL_AUTO, "create");
    config.setProperty(CURRENT_SESSION_CONTEXT_CLASS, "managed");
    config.setProperty(GENERATE_STATISTICS, "false");

    SessionFactory sessionFactory = config.buildSessionFactory();
    openSession(sessionFactory, extensionContext);
    return sessionFactory;
}
 
Example 5
/**
 * Determine the Hibernate database dialect class for the given target database.
 * @param database the target database
 * @return the Hibernate database dialect class, or {@code null} if none found
 */
@SuppressWarnings("deprecation")
protected Class<?> determineDatabaseDialectClass(Database database) {
	switch (database) {
		case DB2: return DB2Dialect.class;
		case DERBY: return DerbyDialect.class;  // DerbyDialect deprecated in 4.x
		case H2: return H2Dialect.class;
		case HSQL: return HSQLDialect.class;
		case INFORMIX: return InformixDialect.class;
		case MYSQL: return MySQL5Dialect.class;
		case ORACLE: return Oracle9iDialect.class;
		case POSTGRESQL: return PostgreSQLDialect.class;  // PostgreSQLDialect deprecated in 4.x
		case SQL_SERVER: return SQLServer2008Dialect.class;
		case SYBASE: return org.hibernate.dialect.SybaseDialect.class;  // SybaseDialect deprecated in 3.6 but not 4.x
		default: return null;
	}
}
 
Example 6
/**
 * Determine the Hibernate database dialect class for the given target database.
 * @param database the target database
 * @return the Hibernate database dialect class, or {@code null} if none found
 */
@SuppressWarnings("deprecation")
protected Class<?> determineDatabaseDialectClass(Database database) {
	switch (database) {
		case DB2: return DB2Dialect.class;
		case DERBY: return DerbyDialect.class;  // DerbyDialect deprecated in 4.x
		case H2: return H2Dialect.class;
		case HSQL: return HSQLDialect.class;
		case INFORMIX: return InformixDialect.class;
		case MYSQL: return MySQLDialect.class;
		case ORACLE: return Oracle9iDialect.class;
		case POSTGRESQL: return PostgreSQLDialect.class;  // PostgreSQLDialect deprecated in 4.x
		case SQL_SERVER: return SQLServerDialect.class;
		case SYBASE: return org.hibernate.dialect.SybaseDialect.class;  // SybaseDialect deprecated in 3.6 but not 4.x
		default: return null;
	}
}
 
Example 7
Source Project: dpCms   Source File: Hibernates.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 从DataSoure中取出connection, 根据connection的metadata中的jdbcUrl判断Dialect类型.
 * 仅支持Oracle, H2, MySql, PostgreSql, SQLServer,如需更多数据库类型,请仿照此类自行编写。
 */
public static String getDialect(DataSource dataSource) {
	String jdbcUrl = getJdbcUrlFromDataSource(dataSource);

	// 根据jdbc url判断dialect
	if (StringUtils.contains(jdbcUrl, ":h2:")) {
		return H2Dialect.class.getName();
	} else if (StringUtils.contains(jdbcUrl, ":mysql:")) {
		return MySQL5InnoDBDialect.class.getName();
	} else if (StringUtils.contains(jdbcUrl, ":oracle:")) {
		return Oracle10gDialect.class.getName();
	} else if (StringUtils.contains(jdbcUrl, ":postgresql:")) {
		return PostgreSQL82Dialect.class.getName();
	} else if (StringUtils.contains(jdbcUrl, ":sqlserver:")) {
		return SQLServer2008Dialect.class.getName();
	} else {
		throw new IllegalArgumentException("Unknown Database of " + jdbcUrl);
	}
}
 
Example 8
Source Project: jhipster   Source File: FixedH2DialectTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void test() {
    List<LogbackRecorder> recorders = new LinkedList<>();
    recorders.add(LogbackRecorder.forName("org.jboss.logging").reset().capture("ALL"));
    recorders.add(LogbackRecorder.forClass(Dialect.class).reset().capture("ALL"));
    recorders.add(LogbackRecorder.forClass(H2Dialect.class).reset().capture("ALL"));

    Map<Integer, String> registered = new LinkedHashMap<>();

    new FixedH2Dialect() {

        @Override
        protected void registerColumnType(int code, String name) {
            registered.put(code, name);
            super.registerColumnType(code, name);
        }

    };

    assertThat(registered.get(Types.FLOAT)).isEqualTo("real");

    recorders.forEach(LogbackRecorder::release);
}
 
Example 9
Source Project: genericdao   Source File: JPAUtil.java    License: Artistic License 2.0 6 votes vote down vote up
/**
 * 从DataSoure中取出connection, 根据connection的metadata中的jdbcUrl判断Dialect类型.
 * 仅支持Oracle 10, H2, MySql, PostgreSql, SQLServer,如需更多数据库类型,请仿照此类自行编写。
 */
public static String getDialect(DataSource dataSource) {
	switch (getDBType(dataSource)) {
		case H2:
			return H2Dialect.class.getName();
		case MYSQL:
			return MySQLDialectWithoutFK.class.getName();
		case ORACLE:
			return Oracle10gDialectWithoutFK.class.getName() ;
		case POSTGRESQL:
			return PostgreSQL9DialectWithoutFK.class.getName() ;
		case SQL_SERVER:
			return SQLServer2008Dialect.class.getName();
	}

	throw new IllegalArgumentException("未知的数据库类型");
}
 
Example 10
Source Project: activiti-in-action-codes   Source File: Hibernates.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 从DataSoure中取出connection, 根据connection的metadata中的jdbcUrl判断Dialect类型.
 * 仅支持Oracle, H2, MySql, PostgreSql, SQLServer,如需更多数据库类型,请仿照此类自行编写。
 */
public static String getDialect(DataSource dataSource) {
    String jdbcUrl = getJdbcUrlFromDataSource(dataSource);

    // 根据jdbc url判断dialect
    if (StringUtils.contains(jdbcUrl, ":h2:")) {
        return H2Dialect.class.getName();
    } else if (StringUtils.contains(jdbcUrl, ":mysql:")) {
        return MySQL5InnoDBDialect.class.getName();
    } else if (StringUtils.contains(jdbcUrl, ":oracle:")) {
        return Oracle10gDialect.class.getName();
    } else if (StringUtils.contains(jdbcUrl, ":postgresql:")) {
        return PostgreSQL82Dialect.class.getName();
    } else if (StringUtils.contains(jdbcUrl, ":sqlserver:")) {
        return SQLServer2008Dialect.class.getName();
    } else {
        throw new IllegalArgumentException("Unknown Database of " + jdbcUrl);
    }
}
 
Example 11
Source Project: activiti-in-action-codes   Source File: Hibernates.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 从DataSoure中取出connection, 根据connection的metadata中的jdbcUrl判断Dialect类型.
 * 仅支持Oracle, H2, MySql, PostgreSql, SQLServer,如需更多数据库类型,请仿照此类自行编写。
 */
public static String getDialect(DataSource dataSource) {
    String jdbcUrl = getJdbcUrlFromDataSource(dataSource);

    // 根据jdbc url判断dialect
    if (StringUtils.contains(jdbcUrl, ":h2:")) {
        return H2Dialect.class.getName();
    } else if (StringUtils.contains(jdbcUrl, ":mysql:")) {
        return MySQL5InnoDBDialect.class.getName();
    } else if (StringUtils.contains(jdbcUrl, ":oracle:")) {
        return Oracle10gDialect.class.getName();
    } else if (StringUtils.contains(jdbcUrl, ":postgresql:")) {
        return PostgreSQL82Dialect.class.getName();
    } else if (StringUtils.contains(jdbcUrl, ":sqlserver:")) {
        return SQLServer2008Dialect.class.getName();
    } else {
        throw new IllegalArgumentException("Unknown Database of " + jdbcUrl);
    }
}
 
Example 12
Source Project: activiti-in-action-codes   Source File: Hibernates.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 从DataSoure中取出connection, 根据connection的metadata中的jdbcUrl判断Dialect类型.
 * 仅支持Oracle, H2, MySql, PostgreSql, SQLServer,如需更多数据库类型,请仿照此类自行编写。
 */
public static String getDialect(DataSource dataSource) {
    String jdbcUrl = getJdbcUrlFromDataSource(dataSource);

    // 根据jdbc url判断dialect
    if (StringUtils.contains(jdbcUrl, ":h2:")) {
        return H2Dialect.class.getName();
    } else if (StringUtils.contains(jdbcUrl, ":mysql:")) {
        return MySQL5InnoDBDialect.class.getName();
    } else if (StringUtils.contains(jdbcUrl, ":oracle:")) {
        return Oracle10gDialect.class.getName();
    } else if (StringUtils.contains(jdbcUrl, ":postgresql:")) {
        return PostgreSQL82Dialect.class.getName();
    } else if (StringUtils.contains(jdbcUrl, ":sqlserver:")) {
        return SQLServer2008Dialect.class.getName();
    } else {
        throw new IllegalArgumentException("Unknown Database of " + jdbcUrl);
    }
}
 
Example 13
Source Project: dubai   Source File: Hibernates.java    License: MIT License 6 votes vote down vote up
/**
 * 从DataSoure中取出connection, 根据connection的metadata中的jdbcUrl判断Dialect类型.
 * 仅支持Oracle, H2, MySql, PostgreSql, SQLServer,如需更多数据库类型,请仿照此类自行编写。
 */
public static String getDialect(DataSource dataSource) {
	String jdbcUrl = getJdbcUrlFromDataSource(dataSource);

	// 根据jdbc url判断dialect
	if (StringUtils.contains(jdbcUrl, ":h2:")) {
		return H2Dialect.class.getName();
	} else if (StringUtils.contains(jdbcUrl, ":mysql:")) {
		return MySQL5InnoDBDialect.class.getName();
	} else if (StringUtils.contains(jdbcUrl, ":oracle:")) {
		return Oracle10gDialect.class.getName();
	} else if (StringUtils.contains(jdbcUrl, ":postgresql:")) {
		return PostgreSQL82Dialect.class.getName();
	} else if (StringUtils.contains(jdbcUrl, ":sqlserver:")) {
		return SQLServer2008Dialect.class.getName();
	} else {
		throw new IllegalArgumentException("Unknown Database of " + jdbcUrl);
	}
}
 
Example 14
Source Project: tutorials   Source File: HibernateWhereJoinTableIntegrationTest.java    License: MIT License 6 votes vote down vote up
@BeforeClass
public static void beforeTests() {
    Configuration configuration = new Configuration().addAnnotatedClass(User.class)
        .addAnnotatedClass(Group.class)
        .addAnnotatedClass(UserGroupRelation.class)
        .setProperty("hibernate.dialect", H2Dialect.class.getName())
        .setProperty("hibernate.connection.driver_class", org.h2.Driver.class.getName())
        .setProperty("hibernate.connection.url", "jdbc:h2:mem:test")
        .setProperty("hibernate.connection.username", "sa")
        .setProperty("hibernate.connection.password", "")
        .setProperty("hibernate.hbm2ddl.auto", "update");
    
    ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder()
        .applySettings(configuration.getProperties())
        .build();
    
    sessionFactory = configuration.buildSessionFactory(serviceRegistry);
}
 
Example 15
public void testLoadSaveRepository() throws
		Exception {

	Class.forName("org.h2.Driver").newInstance();
	Connection theConnection = null;
	try {
		theConnection = DriverManager.getConnection("jdbc:h2:mem:dname", "sa", "");

		Class theHibernateDialect = H2Dialect.class;

		String theModelResource = "/de/erdesignerng/test/io/repository/examplemodel.mxm";

		String theNewFile = RepositioryHelper.performRepositorySaveAndLoad(theModelResource, theHibernateDialect,
				theConnection);

		String theOriginalFile = IOUtils.toString(getClass().getResourceAsStream(theModelResource));

		assertTrue(compareStrings(theOriginalFile, theNewFile));

	} finally {
		if (theConnection != null) {

			theConnection.createStatement().execute("SHUTDOWN");
			theConnection.close();
		}
	}
}
 
Example 16
@Override
protected Map buildSettings() {
	Map settings = super.buildSettings();
	if ( getDialect().getClass().equals( H2Dialect.class ) ) {
		settings.put(
				AvailableSettings.HBM2DDL_IMPORT_FILES,
				"schema-generation.sql"
		);
		settings.put( org.hibernate.cfg.AvailableSettings.HBM2DDL_AUTO, "update" );
	}
	return settings;
}
 
Example 17
@BeforeAll
static void beforeAll() throws Exception {
    DataSourceFactory dbConfig = new DataSourceFactory();
    dbConfig.setDriverClass(Driver.class.getName());
    dbConfig.setUrl("jdbc:h2:mem:./" + JERAHMEEL_JDBC_SUFFIX);
    dbConfig.setProperties(ImmutableMap.<String, String>builder()
            .put(DIALECT, H2Dialect.class.getName())
            .put(HBM2DDL_AUTO, "create")
            .put(GENERATE_STATISTICS, "false")
            .build());

    baseDataDir = Files.createTempDirectory("jerahmeel");

    JerahmeelApplicationConfiguration config = new JerahmeelApplicationConfiguration(
            dbConfig,
            WebSecurityConfiguration.DEFAULT,
            new JerahmeelConfiguration.Builder()
                    .baseDataDir(baseDataDir.toString())
                    .jophielConfig(JophielClientConfiguration.DEFAULT)
                    .sandalphonConfig(SandalphonClientConfiguration.DEFAULT)
                    .gabrielConfig(GabrielClientConfiguration.DEFAULT)
                    .submissionConfig(SubmissionConfiguration.DEFAULT)
                    .build());

    support = new DropwizardTestSupport<>(JerahmeelApplication.class, config);
    support.before();
}
 
Example 18
@BeforeAll
static void beforeAll() throws Exception {
    DataSourceFactory dbConfig = new DataSourceFactory();
    dbConfig.setDriverClass(Driver.class.getName());
    dbConfig.setUrl("jdbc:h2:mem:./" + URIEL_JDBC_SUFFIX);
    dbConfig.setProperties(ImmutableMap.<String, String>builder()
            .put(DIALECT, H2Dialect.class.getName())
            .put(HBM2DDL_AUTO, "create")
            .put(GENERATE_STATISTICS, "false")
            .build());

    baseDataDir = Files.createTempDirectory("uriel");

    UrielApplicationConfiguration config = new UrielApplicationConfiguration(
            dbConfig,
            WebSecurityConfiguration.DEFAULT,
            new UrielConfiguration.Builder()
                    .baseDataDir(baseDataDir.toString())
                    .jophielConfig(JophielClientConfiguration.DEFAULT)
                    .sandalphonConfig(SandalphonClientConfiguration.DEFAULT)
                    .sealtielConfig(SealtielClientConfiguration.DEFAULT)
                    .gabrielConfig(GabrielClientConfiguration.DEFAULT)
                    .submissionConfig(SubmissionConfiguration.DEFAULT)
                    .fileConfig(FileConfiguration.DEFAULT)
                    .build());

    support = new DropwizardTestSupport<>(UrielApplication.class, config);
    support.before();
}
 
Example 19
Source Project: Spring   Source File: JpaConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
	public Map<String, Object> jpaProperties() {
		Map<String, Object> props = new HashMap<>();
		props.put("hibernate.dialect", H2Dialect.class.getName());
//		props.put("hibernate.cache.provider_class", HashtableCacheProvider.class.getName());
		return props;
	}
 
Example 20
Source Project: crnk-framework   Source File: JpaTestConfig.java    License: Apache License 2.0 5 votes vote down vote up
private Properties hibernateProperties() {
	Properties props = new Properties();
	props.setProperty("hibernate.hbm2ddl.auto", "create");
	props.setProperty("hibernate.dialect", H2Dialect.class.getName());
	props.setProperty("hibernate.globally_quoted_identifiers", "true");
	return props;
}
 
Example 21
Source Project: crnk-framework   Source File: OperationsTestConfig.java    License: Apache License 2.0 5 votes vote down vote up
private Properties hibernateProperties() {
	Properties props = new Properties();
	props.setProperty("hibernate.dialect", H2Dialect.class.getName());
	props.setProperty("hibernate.hbm2ddl.auto", "create");
	props.setProperty("hibernate.globally_quoted_identifiers", "true");
	return props;
}
 
Example 22
Source Project: lams   Source File: Database.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Dialect determineDialect(MetadataBuildingOptions buildingOptions) {
	final Dialect dialect = buildingOptions.getServiceRegistry().getService( JdbcServices.class ).getDialect();
	if ( dialect != null ) {
		return dialect;
	}

	// Use H2 dialect as default
	return new H2Dialect();
}
 
Example 23
Source Project: katharsis-framework   Source File: TestConfig.java    License: Apache License 2.0 5 votes vote down vote up
private Properties hibernateProperties() {
	Properties props = new Properties();
	props.setProperty("hibernate.hbm2ddl.auto", "create");
	props.setProperty("hibernate.dialect", H2Dialect.class.getName());
	props.setProperty("hibernate.globally_quoted_identifiers", "true");
	return props;
}
 
Example 24
private String extractData(Clob clob) throws Throwable {
	if ( getDialect() instanceof H2Dialect ) {
		return clob.getSubString( 1, ( int ) clob.length() );
	}
	else {
		char[] data = new char[ (int) clob.length() ];
		clob.getCharacterStream().read( data );
		return new String( data );
	}
}
 
Example 25
Source Project: ps-guitar-db   Source File: JpaConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
	public Map<String, Object> jpaProperties() {
		Map<String, Object> props = new HashMap<String, Object>();
		props.put("hibernate.dialect", H2Dialect.class.getName());
//		props.put("hibernate.cache.provider_class", HashtableCacheProvider.class.getName());
		return props;
	}
 
Example 26
@BeforeClass
public static void beforeTests() {
	Configuration configuration = new Configuration().addAnnotatedClass(Cart.class).addAnnotatedClass(Items.class)
			.setProperty("hibernate.dialect", H2Dialect.class.getName())
			.setProperty("hibernate.connection.driver_class", org.h2.Driver.class.getName())
			.setProperty("hibernate.connection.url", "jdbc:h2:mem:test")
			.setProperty("hibernate.connection.username", "sa").setProperty("hibernate.connection.password", "")
			.setProperty("hibernate.hbm2ddl.auto", "update");
	ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder()
			.applySettings(configuration.getProperties()).build();
	sessionFactory = configuration.buildSessionFactory(serviceRegistry);
}
 
Example 27
@Test
@RequiresDialect( H2Dialect.class )
public void testH2() {
}
 
Example 28
@BeforeAll
static void beforeAll() throws Exception {
    DataSourceFactory dbConfig = new DataSourceFactory();
    dbConfig.setDriverClass(Driver.class.getName());
    dbConfig.setUrl("jdbc:h2:mem:./" + UUID.randomUUID().toString());
    dbConfig.setProperties(ImmutableMap.<String, String>builder()
            .put(DIALECT, H2Dialect.class.getName())
            .put(HBM2DDL_AUTO, "create")
            .put(GENERATE_STATISTICS, "false")
            .build());

    baseDataDir = Files.createTempDirectory("jophiel");

    JophielConfiguration jophielConfig = new JophielConfiguration.Builder()
            .baseDataDir(baseDataDir.toString())
            .mailerConfig(new MailerConfiguration.Builder()
                    .host("localhost")
                    .port(2500)
                    .useSsl(false)
                    .username("wiser")
                    .password("wiser")
                    .sender("[email protected]")
                    .build())
            .userRegistrationConfig(UserRegistrationConfiguration.DEFAULT)
            .userResetPasswordConfig(UserResetPasswordConfiguration.DEFAULT)
            .userAvatarConfig(UserAvatarConfiguration.DEFAULT)
            .superadminCreatorConfig(SuperadminCreatorConfiguration.DEFAULT)
            .build();

    JophielApplicationConfiguration config = new JophielApplicationConfiguration(
            dbConfig,
            WebSecurityConfiguration.DEFAULT,
            jophielConfig);

    support = new DropwizardTestSupport<>(JophielApplication.class, config);
    support.before();

    adminHeader = AuthHeader.of(createService(SessionService.class)
            .logIn(Credentials.of("superadmin", "superadmin"))
            .getToken());
}
 
Example 29
Source Project: lams   Source File: StrategySelectorBuilder.java    License: GNU General Public License v2.0 4 votes vote down vote up
private void addDialects(StrategySelectorImpl strategySelector) {
	addDialect( strategySelector, Cache71Dialect.class );
	addDialect( strategySelector, CUBRIDDialect.class );
	addDialect( strategySelector, DB2Dialect.class );
	addDialect( strategySelector, DB2390Dialect.class );
	addDialect( strategySelector, DB2390V8Dialect.class );
	addDialect( strategySelector, DB2400Dialect.class );
	addDialect( strategySelector, DerbyTenFiveDialect.class );
	addDialect( strategySelector, DerbyTenSixDialect.class );
	addDialect( strategySelector, DerbyTenSevenDialect.class );
	addDialect( strategySelector, FirebirdDialect.class );
	addDialect( strategySelector, FrontBaseDialect.class );
	addDialect( strategySelector, H2Dialect.class );
	addDialect( strategySelector, HANAColumnStoreDialect.class );
	addDialect( strategySelector, HANARowStoreDialect.class );
	addDialect( strategySelector, HSQLDialect.class );
	addDialect( strategySelector, InformixDialect.class );
	addDialect( strategySelector, IngresDialect.class );
	addDialect( strategySelector, Ingres9Dialect.class );
	addDialect( strategySelector, Ingres10Dialect.class );
	addDialect( strategySelector, InterbaseDialect.class );
	addDialect( strategySelector, JDataStoreDialect.class );
	addDialect( strategySelector, MckoiDialect.class );
	addDialect( strategySelector, MimerSQLDialect.class );
	addDialect( strategySelector, MySQL5Dialect.class );
	addDialect( strategySelector, MySQL5InnoDBDialect.class );
	addDialect( strategySelector, MySQL57InnoDBDialect.class );
	addDialect( strategySelector, MySQL57Dialect.class );
	addDialect( strategySelector, Oracle8iDialect.class );
	addDialect( strategySelector, Oracle9iDialect.class );
	addDialect( strategySelector, Oracle10gDialect.class );
	addDialect( strategySelector, PointbaseDialect.class );
	addDialect( strategySelector, PostgresPlusDialect.class );
	addDialect( strategySelector, PostgreSQL81Dialect.class );
	addDialect( strategySelector, PostgreSQL82Dialect.class );
	addDialect( strategySelector, PostgreSQL9Dialect.class );
	addDialect( strategySelector, ProgressDialect.class );
	addDialect( strategySelector, SAPDBDialect.class );
	addDialect( strategySelector, SQLServerDialect.class );
	addDialect( strategySelector, SQLServer2005Dialect.class );
	addDialect( strategySelector, SQLServer2008Dialect.class );
	addDialect( strategySelector, Sybase11Dialect.class );
	addDialect( strategySelector, SybaseAnywhereDialect.class );
	addDialect( strategySelector, SybaseASE15Dialect.class );
	addDialect( strategySelector, SybaseASE157Dialect.class );
	addDialect( strategySelector, TeradataDialect.class );
	addDialect( strategySelector, TimesTenDialect.class );
}
 
Example 30
Source Project: spring-sync   Source File: EmbeddedDataSourceConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public Map<String, Object> jpaProperties() {
		Map<String, Object> props = new HashMap<String, Object>();
		props.put("hibernate.dialect", H2Dialect.class.getName());
		return props;
}