|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - the type of entity bean being queried.public interface QueryResultVisitor<T>
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.
Query<Customer> query = server.find(Customer.class)
.fetch("contacts", new FetchConfig().query(2))
.where().gt("id", 0)
.orderBy("id")
.setMaxRows(2);
query.findVisit(new QueryResultVisitor<Customer>() {
public boolean accept(Customer customer) {
// do something with customer
System.out.println("-- visit " + customer);
return true;
}
});
| Method Summary | |
|---|---|
boolean |
accept(T bean)
Process the bean and return true if you want to continue processing more beans. |
| Method Detail |
|---|
boolean accept(T bean)
bean - the entity bean to process
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||