本文整理了Java中com.avaje.ebean.Query.findVisit
方法的一些代码示例,展示了Query.findVisit
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.findVisit
方法的具体详情如下:
包路径:com.avaje.ebean.Query
类名称:Query
方法名:findVisit
[英]Execute the query using callbacks to a visitor to process the resulting beans one at a time.
Similar to findIterate() this query method does not require all the result beans to be all held in memory at once and as such is 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;
}
});
[中]使用对访问者的回调执行查询,一次一个地处理生成的bean。
与findIterate()类似,此查询方法不要求所有结果bean同时保存在内存中,因此对于处理大型查询非常有用。
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;
}
});
代码示例来源:origin: org.avaje.ebeanorm/avaje-ebeanorm-server
public void findVisit(QueryResultVisitor<T> visitor) {
query.findVisit(visitor);
}
代码示例来源:origin: org.avaje/ebean
public void findVisit(QueryResultVisitor<T> visitor) {
query.findVisit(visitor);
}
代码示例来源:origin: com.typesafe.play/play-java-ebean
public void findVisit(QueryResultVisitor<T> visitor) {
query().findVisit(visitor);
}
内容来源于网络,如有侵权,请联系作者删除!