本文整理汇总了Java中org.jdbi.v3.core.config.ConfigRegistry类的典型用法代码示例。如果您正苦于以下问题:Java ConfigRegistry类的具体用法?Java ConfigRegistry怎么用?Java ConfigRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigRegistry类属于org.jdbi.v3.core.config包,在下文中一共展示了ConfigRegistry类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import org.jdbi.v3.core.config.ConfigRegistry; //导入依赖的package包/类
@Override
protected Argument build(double[] value, ConfigRegistry config) {
return new Argument() {
@Override
public void apply(int position, PreparedStatement statement, StatementContext ctx) throws SQLException {
if (value != null) {
Object[] wrappedValue = new Object[value.length];
for (int i = 0; i < value.length; i++) {
wrappedValue[i] = value[i];
}
statement.setArray(position, ctx.getConnection().createArrayOf("NUMERIC", wrappedValue));
} else {
statement.setNull(position, Types.ARRAY);
}
}
};
}
示例2: build
import org.jdbi.v3.core.config.ConfigRegistry; //导入依赖的package包/类
@Override
public Optional<RowMapper<?>> build(Type type, ConfigRegistry configRegistry) {
if (acceptsPredicate.test(type, configRegistry)) {
RowMapper<?> rowMapper = cache.get(type);
if (rowMapper == null) {
Mapper<ResultSet, ?> resultSetMapper = mapperFactory.newInstance(type);
rowMapper = toRowMapper(resultSetMapper);
RowMapper<?> cachedMapper = cache.putIfAbsent(type, rowMapper);
if (cachedMapper != null) {
rowMapper = cachedMapper;
}
}
return Optional.of(rowMapper);
}
return Optional.empty();
}
示例3: build
import org.jdbi.v3.core.config.ConfigRegistry; //导入依赖的package包/类
@Override
protected Argument build(Money value, ConfigRegistry config) {
BigDecimal amount = value == null ? null : value.getAmount();
return (pos, stmt, context) -> stmt.setBigDecimal(pos, amount);
}
示例4: test
import org.jdbi.v3.core.config.ConfigRegistry; //导入依赖的package包/类
@Override
public boolean test(Type type, ConfigRegistry configRegistry) {
return true;
}
示例5: SfmRowMapperFactory
import org.jdbi.v3.core.config.ConfigRegistry; //导入依赖的package包/类
public SfmRowMapperFactory(BiPredicate<Type, ConfigRegistry> acceptsPredicate, UnaryFactory<Type, Mapper<ResultSet, ?>> mapperFactory) {
this.mapperFactory = mapperFactory;
this.acceptsPredicate = acceptsPredicate;
}