org.skife.jdbi.v2.Query.addStatementCustomizer()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中org.skife.jdbi.v2.Query.addStatementCustomizer方法的一些代码示例,展示了Query.addStatementCustomizer的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.addStatementCustomizer方法的具体详情如下:
包路径:org.skife.jdbi.v2.Query
类名称:Query
方法名:addStatementCustomizer

Query.addStatementCustomizer介绍

暂无

代码示例

代码示例来源:origin: org.kill-bill.commons/killbill-jdbi

private Query setFetchSize(final Query query, final Integer value, final boolean shouldStream) {
    query.addStatementCustomizer(new SmartFetchSizeCustomizer(value, shouldStream));
    return query;
  }
}

代码示例来源:origin: org.kill-bill.commons/killbill-jdbi

/**
 * Specify the maimum number of rows the query is to return. This uses the underlying JDBC
 * {@link Statement#setMaxRows(int)}}.
 *
 * @param maxRows maximum number of rows to return
 *
 * @return modified query
 */
public Query<ResultType> setMaxRows(final int maxRows)
{
  this.addStatementCustomizer(new StatementCustomizers.MaxRowsCustomizer(maxRows));
  return this;
}

代码示例来源:origin: org.kill-bill.commons/killbill-jdbi

/**
 * Specify the maimum field size in the result set. This uses the underlying JDBC
 * {@link Statement#setMaxFieldSize(int)}
 *
 * @param maxFields maximum field size
 *
 * @return modified query
 */
public Query<ResultType> setMaxFieldSize(final int maxFields)
{
  this.addStatementCustomizer(new StatementCustomizers.MaxFieldSizeCustomizer(maxFields));
  return this;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Specify the fetch size for the query. This should cause the results to be
 * fetched from the underlying RDBMS in groups of rows equal to the number passed.
 * This is useful for doing chunked streaming of results when exhausting memory
 * could be a problem.
 *
 * @param fetchSize the number of rows to fetch in a bunch
 *
 * @return the modified query
 */
public Query<ResultType> setFetchSize(final int fetchSize)
{
  this.addStatementCustomizer(new StatementCustomizers.FetchSizeCustomizer(fetchSize));
  return this;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Specify the maimum number of rows the query is to return. This uses the underlying JDBC
 * {@link Statement#setMaxRows(int)}}.
 *
 * @param maxRows maximum number of rows to return
 *
 * @return modified query
 */
public Query<ResultType> setMaxRows(final int maxRows)
{
  this.addStatementCustomizer(new StatementCustomizers.MaxRowsCustomizer(maxRows));
  return this;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Specify the maimum field size in the result set. This uses the underlying JDBC
 * {@link Statement#setMaxFieldSize(int)}
 *
 * @param maxFields maximum field size
 *
 * @return modified query
 */
public Query<ResultType> setMaxFieldSize(final int maxFields)
{
  this.addStatementCustomizer(new StatementCustomizers.MaxFieldSizeCustomizer(maxFields));
  return this;
}

代码示例来源:origin: org.kill-bill.commons/killbill-jdbi

/**
 * Specify the fetch size for the query. This should cause the results to be
 * fetched from the underlying RDBMS in groups of rows equal to the number passed.
 * This is useful for doing chunked streaming of results when exhausting memory
 * could be a problem.
 *
 * @param fetchSize the number of rows to fetch in a bunch
 *
 * @return the modified query
 */
public Query<ResultType> setFetchSize(final int fetchSize)
{
  this.addStatementCustomizer(new StatementCustomizers.FetchSizeCustomizer(fetchSize));
  return this;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

public <T> T first(Class<T> containerType)
{
  addStatementCustomizer(StatementCustomizers.MAX_ROW_ONE);
  ContainerBuilder builder = getContainerMapperRegistry().createBuilderFor(containerType);
  return (T) this.fold(builder, new Folder3<ContainerBuilder, ResultType>()
  {
    public ContainerBuilder fold(ContainerBuilder accumulator, ResultType rs, FoldController control, StatementContext ctx) throws SQLException
    {
      accumulator.add(rs);
      control.abort();
      return accumulator;
    }
  }).build();
}

相关文章