Search in sources :

Example 1 with ColumnMapperFactory

use of org.jdbi.v3.core.mapper.ColumnMapperFactory in project jdbi by jdbi.

the class RegisterColumnMapperFactoryImpl method configureForType.

@Override
public void configureForType(ConfigRegistry registry, Annotation annotation, Class<?> sqlObjectType) {
    RegisterColumnMapperFactory registerColumnMapperFactory = (RegisterColumnMapperFactory) annotation;
    try {
        ColumnMapperFactory factory = registerColumnMapperFactory.value().newInstance();
        registry.get(ColumnMappers.class).register(factory);
    } catch (Exception e) {
        throw new IllegalStateException("unable to create a specified column mapper factory", e);
    }
}
Also used : ColumnMapperFactory(org.jdbi.v3.core.mapper.ColumnMapperFactory) RegisterColumnMapperFactory(org.jdbi.v3.sqlobject.config.RegisterColumnMapperFactory) RegisterColumnMapperFactory(org.jdbi.v3.sqlobject.config.RegisterColumnMapperFactory) ColumnMappers(org.jdbi.v3.core.mapper.ColumnMappers)

Aggregations

ColumnMapperFactory (org.jdbi.v3.core.mapper.ColumnMapperFactory)1 ColumnMappers (org.jdbi.v3.core.mapper.ColumnMappers)1 RegisterColumnMapperFactory (org.jdbi.v3.sqlobject.config.RegisterColumnMapperFactory)1