nutz icon indicating copy to clipboard operation
nutz copied to clipboard

fetchbyjoin 同时拥有 view 与 table 注解的对象时报错

Open KerwinChen opened this issue 5 years ago • 2 comments

有如下实体:

@Table("t_app")
@View("v_app")
public class App {
......
}

在使用 dao.fetchByJoin(App.class, null, id) 时, select 的字段是用 t_app.* 拼接的,但是 from 中却查询的是 v_app。 最终查询语句会报错。 生成的语句:

select t_app.id ..... from v_app left join t_.......

报错:

missing FROM-clause entry for table "t_app"

能否调整为手动指定查询表或者视图?

KerwinChen avatar May 07 '19 08:05 KerwinChen

额, 手动指定是不太可能的, 做个子类吧...

但你说这种情况的确是个bug

wendal avatar May 07 '19 10:05 wendal

好的好的😂那我先用子类处理。

KerwinChen avatar May 08 '19 00:05 KerwinChen