@Test public void testOrdersSince() { OffsetDateTime odt = OffsetDateTime.now().minusDays(20); Date daysAgo = new Date(odt.toInstant().toEpochMilli()); PagedList<Order> orderPaged = Order.find.newOrdersSince(daysAgo, 0); orderPaged.loadRowCount(); List<Order> list = orderPaged.getList(); orderPaged.getTotalRowCount(); for (Order order : list) { order.getCustomer().getName(); List<OrderDetail> details = order.getDetails(); for (OrderDetail detail : details) { detail.getOrderQty(); detail.getShipQty(); detail.getUnitPrice(); detail.getProduct().getName(); } } }
public PagedList<Order> newOrdersSince(Date since, int pageIndex) { return where() .status.in() .status.eq(Order.Status.NEW) .or() .orderDate.after(since) .orderDate.isNull() .endOr() .findPagedList(pageIndex, 100); }
OrderFinder extends Finder<Long,Order> { public PagedList<Order> newOrdersSince(Date since, int pageIndex) { return where() .status.in() .status.eq(Order.Status.NEW) .or() .orderDate.after(since) .orderDate.isNull() .endOr() .findPagedList(pageIndex, 100); } }
OrderFinder extends Finder<Long,Order> { public PagedList<Order> newOrdersSince(Date since, int pageIndex) { return where() .status.in() .status.eq(Order.Status.NEW) .or() .orderDate.after(since) .orderDate.isNull() .endOr() .findPagedList(pageIndex, 100); } OrderFinder();  OrderFinder(String serverName); }
OrderFinder extends Finder<Long,Order> { public PagedList<Order> newOrdersSince(Date since, int pageIndex) { return where() .status.in() .status.eq(Order.Status.NEW) .or() .orderDate.after(since) .orderDate.isNull() .endOr() .findPagedList(pageIndex, 100); } OrderFinder();  OrderFinder(String serverName); List<Order> byStatus(Order.Status... values); PagedList<Order> newOrdersSince(Date since, int pageIndex); }
OrderFinder extends Finder<Long,Order> { public PagedList<Order> newOrdersSince(Date since, int pageIndex) { return where() .status.in() .status.eq(Order.Status.NEW) .or() .orderDate.after(since) .orderDate.isNull() .endOr() .findPagedList(pageIndex, 100); } OrderFinder();  OrderFinder(String serverName); List<Order> byStatus(Order.Status... values); PagedList<Order> newOrdersSince(Date since, int pageIndex);  }