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;
}
Aggregations