org.jdbi.v3.core.mapper.ColumnMapper Java Examples
The following examples show how to use
org.jdbi.v3.core.mapper.ColumnMapper.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SingularityDbModule.java From Singularity with Apache License 2.0 | 5 votes |
@Inject(optional = true) void setMappers( Set<RowMapper<?>> rowMappers, Set<ColumnMapper<?>> columnMappers, @Singularity ObjectMapper objectMapper ) { checkNotNull(rowMappers, "resultSetMappers is null"); this.rowMappers = ImmutableSet.copyOf(rowMappers); this.columnMappers = ImmutableSet.copyOf(columnMappers); this.objectMapper = objectMapper; }
Example #2
Source File: SingularityHistoryModule.java From Singularity with Apache License 2.0 | 4 votes |
@Override public void configure() { Multibinder<RowMapper<?>> rowMappers = Multibinder.newSetBinder( binder(), new TypeLiteral<RowMapper<?>>() {} ); rowMappers .addBinding() .to(SingularityMappers.SingularityRequestHistoryMapper.class) .in(Scopes.SINGLETON); rowMappers .addBinding() .to(SingularityMappers.SingularityTaskIdHistoryMapper.class) .in(Scopes.SINGLETON); rowMappers .addBinding() .to(SingularityMappers.SingularityDeployHistoryLiteMapper.class) .in(Scopes.SINGLETON); rowMappers .addBinding() .to(SingularityMappers.SingularityRequestIdCountMapper.class) .in(Scopes.SINGLETON); rowMappers .addBinding() .to(SingularityMappers.SingularityTaskUsageMapper.class) .in(Scopes.SINGLETON); rowMappers .addBinding() .to(SingularityMappers.SingularityRequestWithTimeMapper.class) .in(Scopes.SINGLETON); Multibinder<ColumnMapper<?>> columnMappers = Multibinder.newSetBinder( binder(), new TypeLiteral<ColumnMapper<?>>() {} ); columnMappers .addBinding() .to(SingularityMappers.SingularityBytesMapper.class) .in(Scopes.SINGLETON); columnMappers.addBinding().to(SingularityIdMapper.class).in(Scopes.SINGLETON); columnMappers.addBinding().to(SingularityJsonStringMapper.class).in(Scopes.SINGLETON); columnMappers .addBinding() .to(SingularityMappers.DateMapper.class) .in(Scopes.SINGLETON); columnMappers .addBinding() .to(SingularityMappers.SingularityTimestampMapper.class) .in(Scopes.SINGLETON); bind(TaskHistoryHelper.class).in(Scopes.SINGLETON); bind(RequestHistoryHelper.class).in(Scopes.SINGLETON); bind(DeployHistoryHelper.class).in(Scopes.SINGLETON); bind(DeployTaskHistoryHelper.class).in(Scopes.SINGLETON); bind(SingularityRequestHistoryPersister.class).in(Scopes.SINGLETON); bind(SingularityDeployHistoryPersister.class).in(Scopes.SINGLETON); bind(SingularityTaskHistoryPersister.class).in(Scopes.SINGLETON); }