Search in sources :

Example 1 with UUIDArgumentFactory

use of com.airbnb.airpal.sql.jdbi.UUIDArgumentFactory in project airpal by airbnb.

the class AirpalModule method provideDBI.

@Singleton
@Provides
public DBI provideDBI(ObjectMapper objectMapper) throws ClassNotFoundException {
    final DBIFactory factory = new DBIFactory();
    final DBI dbi = factory.build(environment, config.getDataSourceFactory(), provideDbType().name());
    dbi.registerMapper(new TableRow.TableRowMapper(objectMapper));
    dbi.registerMapper(new QueryStoreMapper(objectMapper));
    dbi.registerArgumentFactory(new UUIDArgumentFactory());
    dbi.registerArgumentFactory(new URIArgumentFactory());
    return dbi;
}
Also used : URIArgumentFactory(com.airbnb.airpal.sql.jdbi.URIArgumentFactory) UUIDArgumentFactory(com.airbnb.airpal.sql.jdbi.UUIDArgumentFactory) TableRow(com.airbnb.airpal.sql.beans.TableRow) DBI(org.skife.jdbi.v2.DBI) QueryStoreMapper(com.airbnb.airpal.sql.jdbi.QueryStoreMapper) DBIFactory(io.dropwizard.jdbi.DBIFactory) Singleton(com.google.inject.Singleton) Provides(com.google.inject.Provides)

Aggregations

TableRow (com.airbnb.airpal.sql.beans.TableRow)1 QueryStoreMapper (com.airbnb.airpal.sql.jdbi.QueryStoreMapper)1 URIArgumentFactory (com.airbnb.airpal.sql.jdbi.URIArgumentFactory)1 UUIDArgumentFactory (com.airbnb.airpal.sql.jdbi.UUIDArgumentFactory)1 Provides (com.google.inject.Provides)1 Singleton (com.google.inject.Singleton)1 DBIFactory (io.dropwizard.jdbi.DBIFactory)1 DBI (org.skife.jdbi.v2.DBI)1