当前位置: 首页>>代码示例>>Java>>正文


Java ConfigRegistry类代码示例

本文整理汇总了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);
            }
        }
    };
}
 
开发者ID:arteam,项目名称:jdit-examples,代码行数:18,代码来源:DoubleArrayArgumentFactory.java

示例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();
}
 
开发者ID:arnaudroger,项目名称:SimpleFlatMapper,代码行数:18,代码来源:SfmRowMapperFactory.java

示例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);
}
 
开发者ID:qualidafial,项目名称:jdbi-examples,代码行数:6,代码来源:Example04ColumnMapper.java

示例4: test

import org.jdbi.v3.core.config.ConfigRegistry; //导入依赖的package包/类
@Override
public boolean test(Type type, ConfigRegistry configRegistry) {
    return true;
}
 
开发者ID:arnaudroger,项目名称:SimpleFlatMapper,代码行数:5,代码来源:SfmRowMapperFactory.java

示例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;
}
 
开发者ID:arnaudroger,项目名称:SimpleFlatMapper,代码行数:5,代码来源:SfmRowMapperFactory.java


注:本文中的org.jdbi.v3.core.config.ConfigRegistry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。