本文整理了Java中com.avaje.ebean.Query.setListener
方法的一些代码示例,展示了Query.setListener
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setListener
方法的具体详情如下:
包路径:com.avaje.ebean.Query
类名称:Query
方法名:setListener
[英]Set a listener to process the query on a row by row basis.
Use this when you want to process a large query and do not want to hold the entire query result in memory.
It this case the rows are not loaded into the persistence context and instead are processed by the query listener.
QueryListener<Order> listener = ...;
Query<Order> query = Ebean.createQuery(Order.class);
// set the listener that will process each order one at a time
query.setListener(listener);
// execute the query. Note that the returned
// list (emptyList) will be empty ...
List<Order> emtyList = query.findList();
[中]设置侦听器以逐行处理查询。
当您想要处理一个大型查询,并且不想将整个查询结果保存在内存中时,可以使用此选项。
在这种情况下,行不会加载到持久性上下文中,而是由查询侦听器处理。
QueryListener<Order> listener = ...;
Query<Order> query = Ebean.createQuery(Order.class);
// set the listener that will process each order one at a time
query.setListener(listener);
// execute the query. Note that the returned
// list (emptyList) will be empty ...
List<Order> emtyList = query.findList();
代码示例来源:origin: org.avaje.ebeanorm/avaje-ebeanorm-server
public Query<T> setListener(QueryListener<T> queryListener) {
return rootQuery.setListener(queryListener);
}
代码示例来源:origin: org.avaje/ebean
public Query<T> setListener(QueryListener<T> queryListener) {
return rootQuery.setListener(queryListener);
}
代码示例来源:origin: org.avaje.ebeanorm/avaje-ebeanorm-server
public Query<T> setListener(QueryListener<T> queryListener) {
return query.setListener(queryListener);
}
代码示例来源:origin: org.avaje/ebean
public Query<T> setListener(QueryListener<T> queryListener) {
return query.setListener(queryListener);
}
代码示例来源:origin: com.typesafe.play/play-java-ebean
/**
* Sets a listener to process the query on a row-by-row basis.
*/
public Query<T> setListener(QueryListener<T> queryListener) {
return query().setListener(queryListener);
}
内容来源于网络,如有侵权,请联系作者删除!