HSQLDB和JOOQ代码生成

时间:2014-02-09 09:23:54

标签: sql hsqldb jooq

我正在尝试使用JOOQ连接到HSQLDB但是我失败了,这是错误消息:

INFO: Initialising properties  : /codegen.xml
2014-02-09T09:55:19.542+0100  SEVERE  Error while fetching check constraints
org.jooq.exception.DataAccessException: SQL [select "tc"."TABLE_SCHEMA", "tc"."TABLE_NAME", "cc"."CONSTRAINT_NAME", "cc"."CHECK_CLAUSE" from "INFORMATION_SCHEMA"."TABLE_CONSTRAINTS" as "tc" join "INFORMATION_SCHEMA"."CHECK_CONSTRAINTS" as "cc" using( "CONSTRAINT_CATALOG", "CONSTRAINT_SCHEMA", "CONSTRAINT_NAME") where "tc"."TABLE_SCHEMA" in (cast(? as varchar(128)))]; user lacks privilege or object not found: cc.CONSTRAINT_NAME

此查询也在HSQLDB管理器上失败(与JOOQ代码生成器的错误相同):

select "tc"."TABLE_SCHEMA", "tc"."TABLE_NAME", "cc"."CHECK_CLAUSE" , "cc"."CONSTRAINT_NAME"
from "INFORMATION_SCHEMA"."TABLE_CONSTRAINTS" as "tc" 
    join "INFORMATION_SCHEMA"."CHECK_CONSTRAINTS" as "cc" 
    using( "CONSTRAINT_CATALOG", "CONSTRAINT_SCHEMA", "CONSTRAINT_NAME") 

此查询正常工作:

select "tc"."TABLE_SCHEMA", "tc"."TABLE_NAME", "cc"."CHECK_CLAUSE" , "CONSTRAINT_NAME"
from "INFORMATION_SCHEMA"."TABLE_CONSTRAINTS" as "tc" 
    join "INFORMATION_SCHEMA"."CHECK_CONSTRAINTS" as "cc" 
    using( "CONSTRAINT_CATALOG", "CONSTRAINT_SCHEMA", "CONSTRAINT_NAME") 

我认为问题出在“cc”限定符上(在查询返回的“CONSTRAINT_NAME”字段上),这是一个HSQLDB错误吗?

我正在使用:

  • HSQLDB 2.3.1
  • JOOQ 3.2.3

由于 Ciccio

1 个答案:

答案 0 :(得分:0)

这是jOOQ 3.2中的错误。我为此创建了一个问题:#3019。这是与jOOQ当前对JOIN .. USINGNATURAL JOIN #2808的解释相关的更常见错误的副作用。

该错误应该只是装饰性的,不会对代码生成产生任何影响。