【发布时间】:2017-10-16 12:02:26
【问题描述】:
我是 Jooq 的新手。我想将字符串转换为整数。
在表1中定义:-
TableField<?, Integer> city_id;
在表2中定义:-
TableField<?, String> city_id;
在选择查询中。
dsl.select()
.from(Table1)
.leftOuterJoin(Table2)
.on(Table1.city_id.eq(Table2.city_id))
.fetch();
由于 city_id 在 Table1 和 TABLE2 中的格式不同。所以它需要将table2的city_id从String转换为Integer,反之亦然 我试过了 Integer.valueOf(),Integer.parseInt(),不工作。
任何帮助表示赞赏。提前致谢。
【问题讨论】: