Example usage for org.hibernate.dialect MySQL55Dialect MySQL55Dialect

List of usage examples for org.hibernate.dialect MySQL55Dialect MySQL55Dialect

Introduction

In this page you can find the example usage for org.hibernate.dialect MySQL55Dialect MySQL55Dialect.

Prototype

MySQL55Dialect

Source Link

Usage

From source file:org.ligoj.bootstrap.core.dao.SequenceIdentifierGeneratorStrategyProviderTest.java

License:MIT License

private ServiceRegistry newServiceRegistry() {
    var mock = Mockito.mock(ConfigurationService.class);
    Mockito.doReturn(true).when(mock).getSetting(
            AvailableSettings.PREFER_GENERATOR_NAME_AS_DEFAULT_SEQUENCE_NAME, StandardConverters.BOOLEAN, true);
    var jdbcEnvironment = newJdbcEnvironment();
    var serviceRegistry = Mockito.mock(ServiceRegistry.class);
    Mockito.when(serviceRegistry.getService(JdbcEnvironment.class)).thenReturn(jdbcEnvironment);
    Mockito.when(jdbcEnvironment.getDialect()).thenReturn(new MySQL55Dialect());
    Mockito.doReturn(mock).when(serviceRegistry).getService(ConfigurationService.class);
    return serviceRegistry;
}

From source file:org.ligoj.bootstrap.core.dao.SequenceIdentifierGeneratorStrategyProviderTest.java

License:MIT License

/**
 * Check the sequence name from identity table name.
 *//* w  w w  . j ava  2 s  . c om*/
@Test
void testSequenceName() {
    final var params = new Properties();
    params.setProperty("identity_tables", "my_table");
    System.setProperty("hibernate.new_sequence_naming", "true");
    Assertions.assertEquals("my_table_SEQ", newStyleGenerator()
            .determineSequenceName(params, new MySQL55Dialect(), newJdbcEnvironment(), newServiceRegistry())
            .getObjectName().getText());
}

From source file:org.ligoj.bootstrap.core.dao.SequenceIdentifierGeneratorStrategyProviderTest.java

License:MIT License

/**
 * Check the sequence name from identity table name.
 *//*from  ww w .j  a  va  2s .  co  m*/
@Test
void testSequenceNameQuoted() {
    final var params = new Properties();
    params.setProperty("identity_tables", "my_table");
    System.setProperty("hibernate.new_sequence_naming", "true");
    Assertions.assertEquals("my_table_SEQ", newStyleGenerator()
            .determineSequenceName(params, new MySQL55Dialect(), newJdbcEnvironment(), newServiceRegistry())
            .getObjectName().getText());
}