sách gpt4 ăn đã đi

java - Jooq (java) - 方言 DEFAULT 不支持类型类 org.jooq.impl.UnqualifiedName

In lại Tác giả: Walker 123 更新时间:2023-11-30 01:52:43 26 4
mua khóa gpt4 giày nike

你好,我正在方法中执行此操作

public void update(Table table, String tableName){
ArrayList firstRowInDslFormat = new ArrayList<>();
for (Object value : table.getTableDataInRowFormat(false).get(0))
firstRowInDslFormat.add(DSL.name(value.toString()));

for (int rowId = 1; rowId < table.getTableDataInRowFormat(false).size(); rowId++) {
stringBuilder.append("\n" + ctx
.update(DSL.table(DSL.name(tableName)))
.set(
DSL.row(firstRowInDslFormat),
DSL.row(table.getTableDataInRowFormat(false).get(rowId))
)
.where(...).getSQL(ParamType.INLINED) + ";");
}
}

getTableDataInRowFormat() returns Map(Integer,ArrayList) -> Map(rowId, row column values in string)

我不知道如何解决它。正如您在启动方法中看到的那样,我尝试将类型从字符串更改为名称,但它引发了错误:引起原因:org.jooq.exception.SQLDialectNotSupportedException:方言 DEFAULT 中不支持类型类 org.jooq.impl.UnqualifiedName

当我只使用这样的字符串时:

 DSL.row(table.getTableDataInRowFormat(false).get(0)), 
DSL.row(table.getTableDataInRowFormat(false).get(rowId))).where()...

它可以工作...但它会返回带有“”的列名称,正如您在下面的输出中看到的那样...当我运行它时,它会因语法而抛出错误,其中不需要“”。

Output when I use only strings:

  1. update New_tab1 set 'id' = '0', 'name' = 'John' where (id=1);
  2. update New_tab1 set 'id' = '1', 'name' = 'Pierce' where (id=2);

我知道这个主题已经创建,但我认为有点不同。

câu trả lời hay nhất

这绝对是 jOOQ API 的一个限制。您应该能够传递一组 org.jooq.Name 实例(或 org.jooq.Select 实例)到 DSL.row(Collection) 。我为此创建了一个问题:https://github.com/jOOQ/jOOQ/issues/8492

作为解决方法,请使用 Field实例,而不是 Name实例:

ArrayList> firstRowInDslFormat = new ArrayList<>();
for (Object value : table.getTableDataInRowFormat(false).get(0))
firstRowInDslFormat.add(DSL.field(DSL.name(value.toString()), value.getClass()));

关于java - Jooq (java) - 方言 DEFAULT 不支持类型类 org.jooq.impl.UnqualifiedName,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55520420/

26 4 0
Walker 123
Hồ sơ

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá taxi Didi miễn phí
Phiếu giảm giá taxi Didi
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress