Search in sources :

Example 1 with RegisterArgumentFactory

use of org.jdbi.v3.sqlobject.config.RegisterArgumentFactory in project jdbi by jdbi.

the class RegisterArgumentFactoryImpl method configureForType.

@Override
public void configureForType(ConfigRegistry registry, Annotation annotation, Class<?> sqlObjectType) {
    RegisterArgumentFactory raf = (RegisterArgumentFactory) annotation;
    Arguments arguments = registry.get(Arguments.class);
    try {
        arguments.register(raf.value().newInstance());
    } catch (Exception e) {
        throw new IllegalStateException("unable to instantiate specified argument factory", e);
    }
}
Also used : RegisterArgumentFactory(org.jdbi.v3.sqlobject.config.RegisterArgumentFactory) Arguments(org.jdbi.v3.core.argument.Arguments)

Aggregations

Arguments (org.jdbi.v3.core.argument.Arguments)1 RegisterArgumentFactory (org.jdbi.v3.sqlobject.config.RegisterArgumentFactory)1