Commit 493a5124 by Tuomas Riihimäki

Show only slots from paid bills

1 parent f607b9ae
......@@ -107,7 +107,9 @@ public class PlaceSlotFacade extends IntegerPkGenericFacade<PlaceSlot> {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<PlaceSlot> q = cb.createQuery(PlaceSlot.class);
Root<PlaceSlot> root = q.from(PlaceSlot.class);
q.where(cb.equal(root.get(PlaceSlot_.bill).get(Bill_.user), user));
Path<Bill> bill = root.get(PlaceSlot_.bill);
q.where(cb.equal(bill.get(Bill_.user), user),
cb.isNotNull(bill.get(Bill_.paidDate)));
return getEm().createQuery(q).getResultList();
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!