Maybe this helps someone else in the future:
It is possible to implement your own version of JdbcRepositoryFactoryBean
and hard code the Dialect there. The custom class can then be used with the @EnableJdbcRepositories
annotation.
Example configuration for an oracle database:
@EnableJdbcRepositories(basePackageClasses = my.oracle.DbRepository.class,
jdbcOperationsRef = "secondaryNamedParameterJdbcTemplate",
transactionManagerRef = "secondaryTransactionManager",
repositoryFactoryBeanClass = OracleRepositoryFactoryBean.class)
Example of custom factory bean:
public class OracleRepositoryFactoryBean<T extends Repository<S, ID>, S, ID extends Serializable>
extends JdbcRepositoryFactoryBean<T, S, ID> {
// override constructor and set dialect
// override setDialect to be safe
}
If there is a more elegant solution please add it.