Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/368.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jooq Java CTE错误呈现_Java_Postgresql_H2_Jooq - Fatal编程技术网

Jooq Java CTE错误呈现

Jooq Java CTE错误呈现,java,postgresql,h2,jooq,Java,Postgresql,H2,Jooq,我有从DSL创建的CTE。值: final RowN[] rowNS = tasksId .stream() .map(x -> DSL.row(x.toString())) .toArray(RowN[]::new); CommonTableExpression<Record1<String>> cte = DSL .n

我有从DSL创建的CTE。值:

final RowN[] rowNS = tasksId
                .stream()
                .map(x -> DSL.row(x.toString()))
                .toArray(RowN[]::new);

        CommonTableExpression<Record1<String>> cte = DSL
                .name("cte")
                .fields("id")
                .as(DSL
                        .select(
                                DSL.field("id", String.class)
                        )
                        .from(
                                DSL.values(rowNS).as("temp", "id")
                        )
                );
但我只有下一个错误

jOOQ; uncategorized SQLException for SQL [with cte(id) as (select id from ((select null id where 1 = 0) union all (select * from (values(cast(? as varchar))) temp)) temp) select task_id, state from rtm.task_state join cte on rtm.task_state.task_id = cte.id]
我想这是因为从valuescast中选择*?作为瓦查尔

如何修复它? 没有cte的其他方法也可以正常工作。

问题在于:

DSL.field("id", String.class)
需要用DSL.name包装Id

DSL.field(DSL.name("id"), String.class)
DSL.field(DSL.name("id"), String.class)