I have a question regarding JPA criteria.
Here is my JPA criteria query:
CriteriaBuilder criteriaBuilder = getEm().getCriteriaBuilder();
CriteriaQuery&
I found as follows it works:
CriteriaBuilder criteriaBuilder = getEm().getCriteriaBuilder();
CriteriaQuery query = criteriaBuilder.createQuery(InventoryItemSumReport.class);
Root from = query.from(InventoryItemDetail.class);
Join joinItem = from.join(InventoryItemDetail_.inventoryItem);
Predicate where = criteriaBuilder.lessThanOrEqualTo(from.get(InventoryItemDetail_.effectiveDate), date);
Join joinCustomer = joinItem.join(InventoryItem_.customer, JoinType.LEFT);
query.multiselect(joinItem.get(InventoryItem_.product),joinItem.get(InventoryItem_.facility),joinItem.get(InventoryItem_.customer));
query.groupBy(joinItem.get(InventoryItem_.product),joinItem.get(InventoryItem_.facility),joinCustomer);
query.where(where);
TypedQuery createQuery = getEm().createQuery(query);
List resultList = createQuery.getResultList();