List<?> list = this.dao().query(getEntityClass(), cnd, pager);
数据库值: id:1 name: null
list里只有 id
record吗?完整代码和数据
来自炫酷的 NutzCN
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);
System.out.println(Json.toJson(this.dao().query(getEntityClass(),cnd)));
if (!Strings.isBlank(linkname)) {
this.dao().fetchLinks(list, linkname);
}
re.put("data", list);
re.put("draw", draw);
re.put("recordsTotal", length);
System.out.println(list);
System.out.println(re);
return re;
}
[{
"id" :"9",
"loginname" :"yre",
"password" :"31",
"nickname" :"v",
"online" :false,
"disbaled" :false,
"loginSidebar" :false,
"loginBoxed" :false,
"loginScroll" :false
}, {
"id" :"7",
"loginname" :"tfrf",
"password" :"13",
"nickname" :"v",
"online" :false,
"disbaled" :false,
"loginSidebar" :false,
"loginBoxed" :false,
"loginScroll" :false
}]