2
我試圖用JOOQ連接到HSQLDB,但我失敗了,這裏是錯誤消息:HSQLDB和JOOQ代碼生成
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」 QUA (在查詢返回的「CONSTRAINT_NAME」字段上),這是一個HSQLDB錯誤嗎?
我使用:
- HSQLDB 2.3.1
- JOOQ 3.2.3
感謝 Ciccio
刪除連接上的「使用」子句(使用on子句)查詢正常工作。是否有可能強制JOOQ使用和不使用? – CIccio
我只是想讓你知道我已經找到了解決方法,通過更改包含子句「.using」中的子句「.on」的類HSQLDBDatabase,現在它正在工作correclty ..我想..我會讓你知道。 – CIccio