use of de.digitalcollections.cudami.server.backend.impl.jdbi.plugins.JsonbJdbiPlugin 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;
}
use of de.digitalcollections.cudami.server.backend.impl.jdbi.plugins.JsonbJdbiPlugin in project cudami by dbmdz.
the class SpringConfigBackendDatabase method jdbi.
@Bean
Jdbi jdbi(ObjectMapper objectMapper, DataSource dataSource) {
Jdbi jdbi = Jdbi.create(dataSource);
jdbi.installPlugin(new SqlObjectPlugin());
jdbi.installPlugin(new DcCommonsJdbiPlugin());
jdbi.installPlugin(new PostgresPlugin());
jdbi.installPlugin(new JsonbJdbiPlugin(objectMapper));
if (!isMigrated) {
synchronized (isMigrated) {
Map<String, String> placeholders = Map.of("iiifBaseUrl", "foo");
Flyway flyway = Flyway.configure().dataSource(dataSource).placeholders(placeholders).locations("classpath:/de/digitalcollections/cudami/server/backend/impl/database/migration").load();
flyway.migrate();
isMigrated = true;
}
}
return jdbi;
}
Aggregations