使用JOOQ更新SQLITE中的表行失败



jooq正在为sqlite数据库生成无效的更新语句。

这是数据库表。

CREATE TABLE "job" (
`id` integer PRIMARY KEY AUTOINCREMENT, 
`addressId` text,
`log` text
)

有效声明:

update "job" set "log" = (coalesce("log", ?) || ? || ?) WHERE id > 0

Jooq生成的报表

update "job" set "job"."log" = (coalesce("job"."log", ?) || ? || ?) where "job"."id" >= ?

以下是使用的示例代码:

DSL.using(configuration).update(JOB).set(JOB.LOG, DSL.coalesce(JOB.LOG, "")
.concat("char(10)", "Hello"))
.where(JOB.ID.ge(0)).execute()

如何强制jooq生成有效的sqlite更新语句?

对此最有可能的解释是您没有用SQLDialect.SQLITE方言正确配置configuration。在这种方言中,set子句中的列引用是不限定的,任何列或表都不会被引用。

最新更新