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

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

本文整理了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

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

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

  1. /**
  2. * Specify the maimum number of rows the query is to return. This uses the underlying JDBC
  3. * {@link Statement#setMaxRows(int)}}.
  4. *
  5. * @param maxRows maximum number of rows to return
  6. *
  7. * @return modified query
  8. */
  9. public Query<ResultType> setMaxRows(final int maxRows)
  10. {
  11. this.addStatementCustomizer(new StatementCustomizers.MaxRowsCustomizer(maxRows));
  12. return this;
  13. }

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

  1. /**
  2. * Specify the maimum field size in the result set. This uses the underlying JDBC
  3. * {@link Statement#setMaxFieldSize(int)}
  4. *
  5. * @param maxFields maximum field size
  6. *
  7. * @return modified query
  8. */
  9. public Query<ResultType> setMaxFieldSize(final int maxFields)
  10. {
  11. this.addStatementCustomizer(new StatementCustomizers.MaxFieldSizeCustomizer(maxFields));
  12. return this;
  13. }

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

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

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

  1. /**
  2. * Specify the maimum number of rows the query is to return. This uses the underlying JDBC
  3. * {@link Statement#setMaxRows(int)}}.
  4. *
  5. * @param maxRows maximum number of rows to return
  6. *
  7. * @return modified query
  8. */
  9. public Query<ResultType> setMaxRows(final int maxRows)
  10. {
  11. this.addStatementCustomizer(new StatementCustomizers.MaxRowsCustomizer(maxRows));
  12. return this;
  13. }

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

  1. /**
  2. * Specify the maimum field size in the result set. This uses the underlying JDBC
  3. * {@link Statement#setMaxFieldSize(int)}
  4. *
  5. * @param maxFields maximum field size
  6. *
  7. * @return modified query
  8. */
  9. public Query<ResultType> setMaxFieldSize(final int maxFields)
  10. {
  11. this.addStatementCustomizer(new StatementCustomizers.MaxFieldSizeCustomizer(maxFields));
  12. return this;
  13. }

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

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

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

  1. public <T> T first(Class<T> containerType)
  2. {
  3. addStatementCustomizer(StatementCustomizers.MAX_ROW_ONE);
  4. ContainerBuilder builder = getContainerMapperRegistry().createBuilderFor(containerType);
  5. return (T) this.fold(builder, new Folder3<ContainerBuilder, ResultType>()
  6. {
  7. public ContainerBuilder fold(ContainerBuilder accumulator, ResultType rs, FoldController control, StatementContext ctx) throws SQLException
  8. {
  9. accumulator.add(rs);
  10. control.abort();
  11. return accumulator;
  12. }
  13. }).build();
  14. }

相关文章