Class SqlObjectFactory

All Implemented Interfaces:
ExtensionFactory, org.jdbi.v3.core.internal.OnDemandExtensions.Factory

public class SqlObjectFactory extends Object implements ExtensionFactory, org.jdbi.v3.core.internal.OnDemandExtensions.Factory
Creates implementations for SqlObject interfaces.
  • Method Details

    • accepts

      public boolean accepts(Class<?> extensionType)
      Description copied from interface: ExtensionFactory
      Returns true if the factory can attach the given extension type.
      Specified by:
      accepts in interface ExtensionFactory
      extensionType - the extension type.
      whether the factory can produce an extension of the given type.
    • attach

      public <E> E attach(Class<E> extensionType, HandleSupplier handle)
      Create a sql object of the specified type bound to this handle. Any state changes to the handle, or the sql object, such as transaction status, closing it, etc, will apply to both the object and the handle.
      Specified by:
      attach in interface ExtensionFactory
      Type Parameters:
      E - the extension type
      extensionType - the type of sql object to create
      handle - the Handle instance to attach ths sql object to
      the new sql object bound to this handle
      See Also:
    • onDemand

      public Optional<Object> onDemand(Jdbi db, Class<?> extensionType, Class<?>... extraTypes)
      Specified by:
      onDemand in interface org.jdbi.v3.core.internal.OnDemandExtensions.Factory