默认情况下不支持Jooq(java)-类型类org.Jooq.impl.UnqualifiedName
你好,我正在用这种方法做这个默认情况下不支持Jooq(java)-类型类org.Jooq.impl.UnqualifiedName,java,sql,jooq,Java,Sql,Jooq,你好,我正在用这种方法做这个 public void update(Table table, String tableName){ ArrayList<Name> firstRowInDslFormat = new ArrayList<>(); for (Object value : table.getTableDataInRowFormat(false).get(0)) firstRowInDslFormat.add(DSL.name(v
public void update(Table table, String tableName){
ArrayList<Name> 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) + ";");
}
}
它是有效的。。。但它返回的列名为“”,正如您在下面的输出中看到的那样。。。当我运行此命令时,由于语法原因,它将抛出错误,其中不应出现“”
仅使用字符串时的输出:
我知道这个主题已经创建了,但我认为它有点不同。这肯定是jOOQ API中的一个限制。您应该能够将一组实例(或多个实例)传递给。我为此创建了一个问题: 作为解决方法,请使用
字段
实例,而不是名称
实例:
ArrayList<Field<?>> firstRowInDslFormat = new ArrayList<>();
for (Object value : table.getTableDataInRowFormat(false).get(0))
firstRowInDslFormat.add(DSL.field(DSL.name(value.toString()), value.getClass()));
arraylist谢谢你的建议
ArrayList<Field<?>> firstRowInDslFormat = new ArrayList<>();
for (Object value : table.getTableDataInRowFormat(false).get(0))
firstRowInDslFormat.add(DSL.field(DSL.name(value.toString()), value.getClass()));