Interface GeneratedSqlObjectProvider
Connects a
GenerateSqlObject type to the classes that the Jdbi generator created for it.
The generator writes an implementation of this interface next to each generated class and registers it
through ServiceLoader. Jdbi uses the provider to create instances and to learn the
extension methods without reflection, so generated SQL objects work in a GraalVM native image without
reachability metadata. Application code does not implement this interface.
- Since:
- 3.55.0
-
Method Summary
Modifier and TypeMethodDescriptioncreateInstance(ExtensionMetadata extensionMetadata, HandleSupplier handleSupplier, ConfigRegistry config) Creates a new instance of the generated class, bound to a handle.createOnDemand(Jdbi jdbi) Creates a new on-demand instance of the extension type.Returns the methods of the extension type that the generated class implements.Class<?> Returns the extension type that this provider serves.
-
Method Details
-
extensionType
Class<?> extensionType()Returns the extension type that this provider serves.- Returns:
- The extension type, annotated with
GenerateSqlObject
-
extensionMethods
Collection<Method> extensionMethods()Returns the methods of the extension type that the generated class implements.- Returns:
- The extension methods
-
createInstance
Object createInstance(ExtensionMetadata extensionMetadata, HandleSupplier handleSupplier, ConfigRegistry config) Creates a new instance of the generated class, bound to a handle.- Parameters:
extensionMetadata- The metadata for the extension typehandleSupplier- The handle supplier for the new instanceconfig- The configuration for the new instance- Returns:
- A new instance of the extension type
-
createOnDemand
-