【发布时间】:2017-08-23 11:03:39
【问题描述】:
背景:我在我的 nexus 存储库中托管 jooq 3.9.1 的试用版(专有的例如 oracle db 兼容) - 我的 pom 中与 jooq 相关的所有依赖项都指向这一点。
我的 application.properties 中有这一行
jooq.sql-dialect=ORACLE
但是当我检查注入的 dslContext 时,方言设置为“DEFAULT”,而不是预期/期望的 ORACLE。
我目前正在通过自动装配数据源而不是 dslcontext 然后设置 sql 方言来绕过它(如下所示) - 但想知道为什么直接自动装配 dslcontext 不能按预期工作
@Autowired
private DataSourceConnectionProvider dataSource;
public static final SQLDialect sqlDialect = SQLDialect.ORACLE;
public DSLContext getDSL(){
return DSL.using(dataSource, sqlDialect);
}
【问题讨论】:
-
你确定配置应该是
jooq.sql-dialect吗?该手册引用了一个配置spring.jooq.sql-dialect:docs.spring.io/spring-boot/docs/1.5.2.RELEASE/reference/html/… -
作为记录,Spring Boot 本身可能还有一些改进的空间。以防万一,I've registered an issue here
标签: java sql spring-boot jooq