【发布时间】:2018-10-03 16:32:18
【问题描述】:
在 MariaDB (MySQL) 中,我可以执行以下操作:
create table T1 (
t1_field enum('yes', 'no', 'meh')
);
create table T2 (
t2_field enum('yes', 'no', 'meh')
);
insert into T1 (t1_field)
values ('yes'), ('meh');
insert into T2 (t2_field)
select t1_field
from T1;
因为两个枚举是相同的。如果我尝试在 jOOQ 中执行最后一个查询,由于类型不兼容,它将无法工作:
using(t)
.insertInto(T2, T2.T2_FIELD)
.select(
select(
T1.T1_FIELD
)
.from(T1)
)
.execute();
=> InsertValuesStep1 类型中的方法 select(Select>) 不适用于参数 (SelectJoinStep>)
我该如何处理?如何让枚举类型在 jOOQ 中匹配?
【问题讨论】: