Class JdbiExecutorImpl

java.lang.Object
org.jdbi.v3.core.async.AbstractJdbiExecutor
org.jdbi.v3.core.async.JdbiExecutorImpl
All Implemented Interfaces:
JdbiExecutor

@Beta class JdbiExecutorImpl extends AbstractJdbiExecutor
  • Field Details

    • jdbi

      private final Jdbi jdbi
    • executor

      private final Executor executor
  • Constructor Details

    • JdbiExecutorImpl

      JdbiExecutorImpl(Jdbi jdbi, Executor executor)
      Construct a JdbiExecutor.
      Parameters:
      jdbi - the initialized Jdbi class
      executor - an executor to use for all database calls
  • Method Details

    • withExecute

      protected <T> CompletionStage<T> withExecute(CheckedFunction<Jdbi,T> callback)
      Make sure to run the callback in a thread supplied by the executor
      Specified by:
      withExecute in class AbstractJdbiExecutor
      Type Parameters:
      T - type returned by the callback
      Parameters:
      callback - the callback that takes a Jdbi instance and returns a value
      Returns:
      a completion stage that will complete when the callback returns a value or throws an exception