Package org.jdbi.v3.core
Class ConstantHandleSupplier
- java.lang.Object
-
- org.jdbi.v3.core.AbstractHandleSupplier
-
- org.jdbi.v3.core.ConstantHandleSupplier
-
- All Implemented Interfaces:
java.lang.AutoCloseable,HandleSupplier
final class ConstantHandleSupplier extends AbstractHandleSupplier
-
-
Constructor Summary
Constructors Constructor Description ConstantHandleSupplier(Handle handle)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigRegistrygetConfig()Returns the current Jdbi config.HandlegetHandle()Returns a handle, possibly creating it lazily.JdbigetJdbi()Returns the owning Jdbi instance.(package private) static HandleSupplierof(Handle handle)protected voidwithHandle(java.util.function.Consumer<Handle> handleConsumer)-
Methods inherited from class org.jdbi.v3.core.AbstractHandleSupplier
close, currentExtensionContext, invokeInContext
-
-
-
-
Field Detail
-
handle
private final Handle handle
-
-
Constructor Detail
-
ConstantHandleSupplier
ConstantHandleSupplier(Handle handle)
-
-
Method Detail
-
of
static HandleSupplier of(Handle handle)
-
getJdbi
public Jdbi getJdbi()
Description copied from interface:HandleSupplierReturns the owning Jdbi instance.- Returns:
- The owning Jdbi instance.
-
getConfig
public ConfigRegistry getConfig()
Description copied from interface:HandleSupplierReturns the current Jdbi config.- Returns:
- The current Jdbi configuration.
-
getHandle
public Handle getHandle()
Description copied from interface:HandleSupplierReturns a handle, possibly creating it lazily. A Handle holds a database connection, so extensions should only call this method in order to interact with the database.- Returns:
- An open Handle.
-
withHandle
protected void withHandle(java.util.function.Consumer<Handle> handleConsumer)
- Specified by:
withHandlein classAbstractHandleSupplier
-
-