findPage数据查询
public Page<OrderPack> findPage(OrderStatus orderStatus, Boolean isAllPostalInConfirmed, Set<Storage> storages, Pageable pageable) {
CriteriaBuilder cb = this.entityManager.getCriteriaBuilder();
CriteriaQuery<OrderPack> cq = cb.createQuery(OrderPack.class);
Root root = cq.from(OrderPack.class);
cq.select(root);
Predicate predicate = cb.conjunction();
if (orderStatus != null) {
predicate = cb.and(predicate, cb.equal(root.get("orderStatus"), orderStatus));
}
if(isAllPostalInConfirmed != null) {
predicate = cb.and(predicate,cb.equal(root.get("isAllPostalInConfirmed"), isAllPostalInConfirmed));
}
if(storages != null && !storages.isEmpty()) {
predicate = cb.and(predicate, root.get("storage").in(storages));
}
cq.where(predicate);
return findPage(cq, pageable);
}
事情是这样的:findPage数据查询前面段时间都能返回数据,过了大该两周现在新添加的数据就查询不到了。不知道怎么排查,应该从哪方面入手呢?findPage是分页查询,前台页面没有返回值,不知道后台怎么看它有没有返回值? --------------------编程问答-------------------- hql代码应该没有错,我也看不懂。主要是这个项目的"发货定单","打包定单","拆包定单"几个定单都查询不到数据了。都是一样的写法。
补充:Java , Java EE