多变联查返回多个实体对象
public List<Sys_menu> getMenusAndButtons(String userId) {
Sql sql = Sqls.create("select distinct a.* from sys_menu a,sys_role_menu b where a.id=b.menuId and" +
" b.roleId in(select c.roleId from sys_user_role c,sys_role d where c.roleId=d.id and c.userId=@userId and d.disabled=0) and a.disabled=0 order by a.location ASC,a.path asc");
sql.params().set("userId", userId);
Entity<Sys_menu> entity = dao().getEntity(Sys_menu.class);
sql.setEntity(entity);
sql.setCallback(Sqls.callback.entities());
dao().execute(sql);
return sql.getList(Sys_menu.class);
}
我是不是应该加上Entity entity2 = dao().getEntity(Entity2.class);
sql.setEntity(entity2);
那么我的返回值应该是什么类型......
然后发回前端的只能手动把得到的实体拼接起来么