Class ResultProducers

java.lang.Object
org.jdbi.v3.core.result.ResultProducers
All Implemented Interfaces:
JdbiConfig<ResultProducers>

public class ResultProducers extends Object implements JdbiConfig<ResultProducers>
Commonly used ResultProducer implementations.
  • Constructor Details

    • ResultProducers

      public ResultProducers()
  • Method Details

    • returningUpdateCount

      public static ResultProducer<Integer> returningUpdateCount()
      Result producer that eagerly executes the statement, returning the update count
      Returns:
      update count
      See Also:
      Statement.getUpdateCount()
    • returningResults

      public static ResultProducer<ResultBearing> returningResults()
      Result producer that returns a ResultBearing over the statement result rows.
      Returns:
      ResultBearing of result rows.
      See Also:
      Statement.getResultSet()
    • returningGeneratedKeys

      public static ResultProducer<ResultBearing> returningGeneratedKeys(String... generatedKeyColumnNames)
      Result producer that returns a ResultBearing over the statement-generated keys.
      Parameters:
      generatedKeyColumnNames - optional list of generated key column names.
      Returns:
      ResultBearing of generated keys
      See Also:
      Statement.getGeneratedKeys()
    • createCopy

      public ResultProducers createCopy()
      Description copied from interface: JdbiConfig
      Returns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.
      Specified by:
      createCopy in interface JdbiConfig<ResultProducers>
      Returns:
      a copy of this configuration object.
    • allowNoResults

      public ResultProducers allowNoResults(boolean allowed)
      Normally a query that doesn't return a result set throws an exception. With this option, we will replace it with an empty result set instead.
      Parameters:
      allowed - the new allowNoResults setting
      Returns:
      this