Search in sources :

Example 1 with JdbiFactoryBean

use of org.jdbi.v3.spring5.JdbiFactoryBean in project cudami by dbmdz.

the class SpringConfigBackendDatabase method jdbi.

@Bean
public JdbiFactoryBean jdbi(DataSource ds, ObjectMapper objectMapper) throws Exception {
    JdbiFactoryBean jdbiFactoryBean = new JdbiFactoryBean(ds);
    List plugins = new ArrayList();
    plugins.add(new SqlObjectPlugin());
    plugins.add(new PostgresPlugin());
    plugins.add(new DcCommonsJdbiPlugin());
    plugins.add(new JsonbJdbiPlugin(objectMapper));
    jdbiFactoryBean.setPlugins(plugins);
    return jdbiFactoryBean;
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) SqlObjectPlugin(org.jdbi.v3.sqlobject.SqlObjectPlugin) JdbiFactoryBean(org.jdbi.v3.spring5.JdbiFactoryBean) DcCommonsJdbiPlugin(de.digitalcollections.commons.jdbi.DcCommonsJdbiPlugin) JsonbJdbiPlugin(de.digitalcollections.cudami.server.backend.impl.jdbi.plugins.JsonbJdbiPlugin) PostgresPlugin(org.jdbi.v3.postgres.PostgresPlugin) JdbiFactoryBean(org.jdbi.v3.spring5.JdbiFactoryBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

DcCommonsJdbiPlugin (de.digitalcollections.commons.jdbi.DcCommonsJdbiPlugin)1 JsonbJdbiPlugin (de.digitalcollections.cudami.server.backend.impl.jdbi.plugins.JsonbJdbiPlugin)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 PostgresPlugin (org.jdbi.v3.postgres.PostgresPlugin)1 JdbiFactoryBean (org.jdbi.v3.spring5.JdbiFactoryBean)1 SqlObjectPlugin (org.jdbi.v3.sqlobject.SqlObjectPlugin)1 Bean (org.springframework.context.annotation.Bean)1