请问nutz 框架 查询出list集合 对象关联的数据
4 回复
public NutMap data(int length, int start, int draw, List<DataTableOrder> orders, List<DataTableColumn> columns, Cnd cnd, String linkname) {
NutMap re = new NutMap();
if (orders != null && orders.size() > 0) {
for (DataTableOrder order : orders) {
DataTableColumn col = columns.get(order.getColumn());
cnd.orderBy(Sqls.escapeSqlFieldValue(col.getData()).toString(), order.getDir());
}
}
Pager pager = new OffsetPager(start, length);
re.put("recordsFiltered", this.dao().count(getEntityClass(), cnd));
List<?> list = this.dao().query(getEntityClass(), cnd, pager);
if (!Strings.isBlank(linkname)) {
this.dao().fetchLinks(list, linkname);
}
this.dao().fetchLinks(list, null);
re.put("data", list);
re.put("draw", draw);
re.put("recordsTotal", length);
return re;
}
我改造的原始方式不知道对不对 ,因为我要在列表里面获取关联对象的值
添加回复
请先登陆