在使用jOOQ从名为user
的表中进行选择时,我遇到了以下异常:
jOOQ; bad SQL grammar [insert into user (user_id, account_type) values (?, ?)]; nested exception is org.postgresql.util.PSQLException: ERROR: syntax error at or near "user"
我的jOOQ设置如下:
private static final Settings jooqSettings = new Settings()
.withRenderSchema(false)
.withRenderNameStyle(RenderNameStyle.LOWER);
我从这个创建一个DSLContext
,然后在事务中构建查询,如下所示:
ctx.insertInto(USER)
.set(USER.USER_ID, userId)
.set(USER.ACCOUNT_TYPE, "U")
.execute()
USER
被导入为<jooq-generated-package>.tables.USER
。
jOOQ是否有一个配置属性来转义表名(所有或只是保留关键字)?我在文档或源代码中找不到任何相关信息。