Package org.jdbi.v3.core.result
Class ResultProducers
java.lang.Object
org.jdbi.v3.core.result.ResultProducers
- All Implemented Interfaces:
- JdbiConfig<ResultProducers>
Commonly used ResultProducer implementations.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceReturns a ResultSet from a Statement.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionallowNoResults(boolean allowNoResults) Normally a query that doesn't return a result set throws an exception.Returns a copy of this configuration object.static ResultBearingcreateResultBearing(Supplier<PreparedStatement> preparedStatementSupplier, ResultProducers.ResultSetCreator resultSetCreator, StatementContext ctx) Create aResultBearinginstance backed by aResultSet.static ResultProducer<ResultBearing> returningGeneratedKeys(String... generatedKeyColumnNames) Result producer that returns aResultBearingover the statement-generated keys.static ResultProducer<ResultBearing> Result producer that returns aResultBearingover the statement result rows.static ResultProducer<Integer> Result producer that eagerly executes the statement, returning the update countMethods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jdbi.v3.core.config.JdbiConfigsetRegistry
- 
Constructor Details- 
ResultProducerspublic ResultProducers()
 
- 
- 
Method Details- 
returningUpdateCountResult producer that eagerly executes the statement, returning the update count- Returns:
- update count
- See Also:
 
- 
returningResultsResult producer that returns aResultBearingover the statement result rows.- Returns:
- ResultBearing of result rows.
- See Also:
 
- 
returningGeneratedKeyspublic static ResultProducer<ResultBearing> returningGeneratedKeys(String... generatedKeyColumnNames) Result producer that returns aResultBearingover the statement-generated keys.- Parameters:
- generatedKeyColumnNames- optional list of generated key column names.
- Returns:
- ResultBearing of generated keys
- See Also:
 
- 
createResultBearingpublic static ResultBearing createResultBearing(Supplier<PreparedStatement> preparedStatementSupplier, ResultProducers.ResultSetCreator resultSetCreator, StatementContext ctx) Create aResultBearinginstance backed by aResultSet. This method can be used to create otherResultProducerinstances that manage aResultBearinginstance.- Parameters:
- preparedStatementSupplier- Provides the- PreparedStatementto obtain the- ResultSet.
- resultSetCreator- Creates a- ResultSetfrom a- Statement.
- ctx- The statement context.
- Returns:
- An instance of ResultBearingthat is backed by theResultSet.
 
- 
createCopyDescription copied from interface:JdbiConfigReturns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.- Specified by:
- createCopyin interface- JdbiConfig<ResultProducers>
- Returns:
- a copy of this configuration object.
 
- 
allowNoResultsNormally 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:
- allowNoResults- True if an empty- ResultSetobject should be returned, false if a- NoResultsExceptionshould be thrown.
- Returns:
- this
 
 
-