Package org.jdbi.v3.sqlobject
Class GeneratorSqlObjectFactory
- java.lang.Object
-
- org.jdbi.v3.sqlobject.AbstractSqlObjectFactory
-
- org.jdbi.v3.sqlobject.GeneratorSqlObjectFactory
-
- All Implemented Interfaces:
ExtensionFactory,OnDemandExtensions.Factory
public final class GeneratorSqlObjectFactory extends AbstractSqlObjectFactory implements OnDemandExtensions.Factory
Support for generator instances (concrete classes that have been created by the Jdbi generator).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jdbi.v3.core.extension.ExtensionFactory
ExtensionFactory.FactoryFlag
-
-
Constructor Summary
Constructors Constructor Description GeneratorSqlObjectFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccepts(java.lang.Class<?> extensionType)Returns true if the factory can process the given extension type.<E> Eattach(java.lang.Class<E> extensionType, HandleSupplier handleSupplier)Attach a sql object from a jdbi generator created class.java.util.Set<ExtensionFactory.FactoryFlag>getFactoryFlags()Returns a set ofExtensionFactory.FactoryFlags that describe the extension factory.private java.lang.StringgetGeneratedClassName(java.lang.Class<?> extensionType)private java.lang.StringgetOnDemandClassName(java.lang.Class<?> extensionType)java.util.Optional<java.lang.Object>onDemand(Jdbi jdbi, java.lang.Class<?> extensionType, java.lang.Class<?>... extraTypes)-
Methods inherited from class org.jdbi.v3.sqlobject.AbstractSqlObjectFactory
buildExtensionMetadata, getConfigCustomizerFactories, getExtensionHandlerCustomizers, getExtensionHandlerFactories, isConcrete
-
-
-
-
Method Detail
-
accepts
public boolean accepts(java.lang.Class<?> extensionType)
Description copied from interface:ExtensionFactoryReturns true if the factory can process the given extension type.- Specified by:
acceptsin interfaceExtensionFactory- Parameters:
extensionType- the extension type- Returns:
- whether the factory can produce an extension of the given type
-
getFactoryFlags
public java.util.Set<ExtensionFactory.FactoryFlag> getFactoryFlags()
Description copied from interface:ExtensionFactoryReturns a set ofExtensionFactory.FactoryFlags that describe the extension factory.- Specified by:
getFactoryFlagsin interfaceExtensionFactory- Returns:
- A set of
ExtensionFactory.FactoryFlagelements. Default is the empty set
-
attach
public <E> E attach(java.lang.Class<E> extensionType, HandleSupplier handleSupplier)Attach a sql object from a jdbi generator created class.- Specified by:
attachin interfaceExtensionFactory- Type Parameters:
E- the extension type- Parameters:
extensionType- the type of sql object to create.handleSupplier- the Handle instance to attach this sql object to.- Returns:
- the new sql object bound to this handle.
- See Also:
Jdbi.onDemand(Class)
-
onDemand
public java.util.Optional<java.lang.Object> onDemand(Jdbi jdbi, java.lang.Class<?> extensionType, java.lang.Class<?>... extraTypes)
- Specified by:
onDemandin interfaceOnDemandExtensions.Factory
-
getGeneratedClassName
private java.lang.String getGeneratedClassName(java.lang.Class<?> extensionType)
-
getOnDemandClassName
private java.lang.String getOnDemandClassName(java.lang.Class<?> extensionType)
-
-