本文整理了Java中io.ebean.Query.setBufferFetchSizeHint
方法的一些代码示例,展示了Query.setBufferFetchSizeHint
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setBufferFetchSizeHint
方法的具体详情如下:
包路径:io.ebean.Query
类名称:Query
方法名:setBufferFetchSizeHint
[英]A hint which for JDBC translates to the Statement.fetchSize().
Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for ResultSet.
Note that internally findEach and findEachWhile will set the fetch size if it has not already as these queries expect to process a lot of rows. If we didn't then Postgres and MySql for example would eagerly pull back all the row data and potentially consume a lot of memory in the process.
As findEach and findEachWhile automatically set the fetch size we don't have to do so generally but we might still wish to for tuning a specific use case.
[中]对于JDBC,这是一个转换为语句的提示。fetchSize()。
当ResultSet需要更多行时,向JDBC驱动程序提示应该从数据库中获取的行数。
请注意,如果findEach和findEachWhile还没有设置取数大小,那么它们会在内部设置取数大小,因为这些查询预期会处理很多行。如果我们不这样做,例如Postgres和MySql将急切地收回所有行数据,并可能在这个过程中消耗大量内存。
由于findEach和findEachWhile会自动设置获取大小,我们通常不必这样做,但我们可能仍然希望调整特定的用例。
代码示例来源:origin: org.actframework/act-ebean
@Override
public EbeanQuery<MODEL_TYPE> setBufferFetchSizeHint(int fetchSize) {
q.setBufferFetchSizeHint(fetchSize);
qReadOnly.setBufferFetchSizeHint(fetchSize);
return this;
}
代码示例来源:origin: io.ebean/ebean-querybean
/**
* A hint which for JDBC translates to the Statement.fetchSize().
* <p>
* Gives the JDBC driver a hint as to the number of rows that should be
* fetched from the database when more rows are needed for ResultSet.
* </p>
*/
public R setBufferFetchSizeHint(int fetchSize) {
query.setBufferFetchSizeHint(fetchSize);
return root;
}
代码示例来源:origin: org.actframework/act-ebean2
@Override
public EbeanQuery<MODEL_TYPE> setBufferFetchSizeHint(int fetchSize) {
q.setBufferFetchSizeHint(fetchSize);
return this;
}
代码示例来源:origin: icode/ameba
/**
* {@inheritDoc}
* Sets a hint, which for JDBC translates to <code>Statement.fetchSize()</code>.
*/
public Query<T> setBufferFetchSizeHint(int fetchSize) {
return query().setBufferFetchSizeHint(fetchSize);
}
内容来源于网络,如有侵权,请联系作者删除!