Search in sources :

Example 1 with DBIProvider

use of org.killbill.commons.jdbi.guice.DBIProvider in project killbill by killbill.

the class DBTestingHelper method getDBI.

@Override
public synchronized IDBI getDBI() {
    if (dbi == null) {
        final RetryableDataSource retryableDataSource = new RetryableDataSource(getDataSource());
        dbi = (DBI) new DBIProvider(null, retryableDataSource, null).get();
        // Register KB specific mappers
        for (final ResultSetMapperFactory resultSetMapperFactory : IDBISetup.mapperFactoriesToRegister()) {
            dbi.registerMapper(resultSetMapperFactory);
        }
        for (final ResultSetMapper resultSetMapper : IDBISetup.mappersToRegister()) {
            dbi.registerMapper(resultSetMapper);
        }
    }
    return dbi;
}
Also used : ResultSetMapperFactory(org.skife.jdbi.v2.ResultSetMapperFactory) ResultSetMapper(org.skife.jdbi.v2.tweak.ResultSetMapper) DBIProvider(org.killbill.commons.jdbi.guice.DBIProvider)

Aggregations

DBIProvider (org.killbill.commons.jdbi.guice.DBIProvider)1 ResultSetMapperFactory (org.skife.jdbi.v2.ResultSetMapperFactory)1 ResultSetMapper (org.skife.jdbi.v2.tweak.ResultSetMapper)1