All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avaje.ebean.QueryEachConsumer Maven / Gradle / Ivy

There is a newer version: 8.1.1
Show newest version
package com.avaje.ebean;

/**
 * Used to process a query result one bean at a time via a callback to this
 * visitor.
 * 

* If you wish to stop further processing return false from the accept method. *

*

* Unlike findList() and findSet() using a QueryResultVisitor does not require * all the beans in the query result to be held in memory at once. This makes * QueryResultVisitor useful for processing large queries. *

* *
{@code
 *
 * Query query = server.find(Customer.class)
 *     .where().eq("status", Status.NEW)
 *     .order().asc("id");
 *
 * query.findEach((Customer customer) -> {
 *
 *     // do something with customer
 *     System.out.println("-- visit " + customer);
 * });
 *
 * }
* * @param * the type of entity bean being queried. */ public interface QueryEachConsumer { /** * Process the bean. * * @param bean * the entity bean to process */ void accept(T bean); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy