class CoffeeShop {

    @Scheduled(every = "2s")
    public void processUnfinishedOrders() {
        entityManager.createNamedQuery(Order.FIND_UNFINISHED, Order.class)
                .getResultList()
                .forEach(orderProcessor::processOrder);
    }

}