use of org.jdbi.v3.core.config.ConfigRegistry in project jdbi by jdbi.
the class RegisterConstructorMappersImpl method configureForType.
@Override
public void configureForType(ConfigRegistry registry, Annotation annotation, Class<?> sqlObjectType) {
Configurer delegate = new RegisterConstructorMapperImpl();
RegisterConstructorMappers registerConstructorMappers = (RegisterConstructorMappers) annotation;
Stream.of(registerConstructorMappers.value()).forEach(anno -> delegate.configureForType(registry, anno, sqlObjectType));
}
use of org.jdbi.v3.core.config.ConfigRegistry in project jdbi by jdbi.
the class RegisterJoinRowMapperImpl method configureForType.
@Override
public void configureForType(ConfigRegistry registry, Annotation annotation, Class<?> sqlObjectType) {
RegisterJoinRowMapper registerJoinRowMapper = (RegisterJoinRowMapper) annotation;
registry.get(RowMappers.class).register(JoinRowMapper.forTypes(registerJoinRowMapper.value()));
}
use of org.jdbi.v3.core.config.ConfigRegistry in project jdbi by jdbi.
the class RegisterRowMapperFactoryImpl method configureForType.
@Override
public void configureForType(ConfigRegistry registry, Annotation annotation, Class<?> sqlObjectType) {
RegisterRowMapperFactory registerRowMapperFactory = (RegisterRowMapperFactory) annotation;
RowMappers mappers = registry.get(RowMappers.class);
try {
mappers.register(registerRowMapperFactory.value().newInstance());
} catch (Exception e) {
throw new IllegalStateException("unable to create a specified row mapper factory", e);
}
}
use of org.jdbi.v3.core.config.ConfigRegistry in project jdbi by jdbi.
the class RegisterRowMappersImpl method configureForType.
@Override
public void configureForType(ConfigRegistry registry, Annotation annotation, Class<?> sqlObjectType) {
Configurer delegate = new RegisterRowMapperImpl();
RegisterRowMappers registerRowMappers = (RegisterRowMappers) annotation;
Stream.of(registerRowMappers.value()).forEach(anno -> delegate.configureForType(registry, anno, sqlObjectType));
}
use of org.jdbi.v3.core.config.ConfigRegistry in project jdbi by jdbi.
the class UseSqlParserImpl method configureForType.
@Override
public void configureForType(ConfigRegistry registry, Annotation annotation, Class<?> sqlObjectType) {
UseSqlParser anno = (UseSqlParser) annotation;
try {
final SqlParser parser = instantiate(anno.value(), sqlObjectType, null);
registry.get(SqlStatements.class).setSqlParser(parser);
} catch (Exception e) {
throw new IllegalStateException(e);
}
}
Aggregations