use of org.jdbi.v3.sqlobject.config.RegisterObjectArgumentFactory in project jdbi by jdbi.
the class RegisterObjectArgumentFactoryImpl method configureForType.
@Override
public void configureForType(ConfigRegistry registry, Annotation annotation, Class<?> sqlObjectType) {
RegisterObjectArgumentFactory registerObjectArgumentFactory = (RegisterObjectArgumentFactory) annotation;
Arguments arguments = registry.get(Arguments.class);
Class<?> clazz = registerObjectArgumentFactory.value();
int sqlType = registerObjectArgumentFactory.sqlType();
if (sqlType == Integer.MIN_VALUE) {
arguments.register(ObjectArgumentFactory.create(clazz));
} else {
arguments.register(ObjectArgumentFactory.create(clazz, sqlType));
}
}
Aggregations