Package org.jdbi.v3.spring5
Class JdbiFactoryBean
- java.lang.Object
-
- org.springframework.beans.factory.config.AbstractFactoryBean<Jdbi>
-
- org.jdbi.v3.spring5.JdbiFactoryBean
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean<Jdbi>,org.springframework.beans.factory.InitializingBean
public class JdbiFactoryBean extends org.springframework.beans.factory.config.AbstractFactoryBean<Jdbi>
Utility class which constructs anJdbiinstance which can conveniently participate in Spring's transaction management system.
-
-
Constructor Summary
Constructors Constructor Description JdbiFactoryBean()JdbiFactoryBean(DataSource dataSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()Verifies that a dataSource has been setprotected JdbicreateInstance()Class<Jdbi>getObjectType()SeeFactoryBean.getObjectType()JdbiFactoryBeansetAutoInstallPlugins(boolean autoInstallPlugins)Sets whether to install plugins automatically from the classpath, usingServiceLoadermanifests.JdbiFactoryBeansetDataSource(DataSource dataSource)The datasource, which should be managed by spring's transaction system, from which theJdbiwill obtain connectionsvoidsetGlobalDefines(Map<String,Object> defines)JdbiFactoryBeansetPlugins(Collection<JdbiPlugin> plugins)Installs the given plugins which will be installed into theJdbi.
-
-
-
Constructor Detail
-
JdbiFactoryBean
public JdbiFactoryBean()
-
JdbiFactoryBean
public JdbiFactoryBean(DataSource dataSource)
-
-
Method Detail
-
setDataSource
public JdbiFactoryBean setDataSource(DataSource dataSource)
The datasource, which should be managed by spring's transaction system, from which theJdbiwill obtain connections- Parameters:
dataSource- the data source.- Returns:
- this
-
setPlugins
@Autowired(required=false) public JdbiFactoryBean setPlugins(Collection<JdbiPlugin> plugins)
Installs the given plugins which will be installed into theJdbi.- Parameters:
plugins- collection of Jdbi plugins to install.- Returns:
- this
-
setAutoInstallPlugins
public JdbiFactoryBean setAutoInstallPlugins(boolean autoInstallPlugins)
Sets whether to install plugins automatically from the classpath, usingServiceLoadermanifests.- Parameters:
autoInstallPlugins- whether to install plugins automatically from the classpath.- Returns:
- this
- See Also:
for detail
-
afterPropertiesSet
public void afterPropertiesSet() throws ExceptionVerifies that a dataSource has been set
-
-