Java 如何在JDBI3升级中更改BinderFactory实现
目前,我正在从JDBI2升级到JDBI3,但似乎没有明显的BinderFactory翻译,升级文档中也没有提到Java 如何在JDBI3升级中更改BinderFactory实现,java,dropwizard,jdbi,Java,Dropwizard,Jdbi,目前,我正在从JDBI2升级到JDBI3,但似乎没有明显的BinderFactory翻译,升级文档中也没有提到 import org.skife.jdbi.v2.sqlobject.Binder; import org.skife.jdbi.v2.sqlobject.BinderFactory; import org.skife.jdbi.v2.sqlobject.BindingAnnotation; @BindingAnnotation(LoadTypeBinder.LoadTypeBind
import org.skife.jdbi.v2.sqlobject.Binder;
import org.skife.jdbi.v2.sqlobject.BinderFactory;
import org.skife.jdbi.v2.sqlobject.BindingAnnotation;
@BindingAnnotation(LoadTypeBinder.LoadTypeBinderFactory.class)
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PARAMETER})
public @interface LoadTypeBinder {
/**
* Value.
*
* @return
*/
String value() default "it";
class LoadTypeBinderFactory implements BinderFactory {
@Override
public Binder build(Annotation annotation) {
return (Binder<LoadTypeBinder, SolrDbDao.LoadType>)
(q, bind, arg) -> q.bind(bind.value(), arg.value());
}
}
}
import org.skife.jdbi.v2.sqlobject.Binder;
导入org.skife.jdbi.v2.sqlobject.BinderFactory;
导入org.skife.jdbi.v2.sqlobject.BindingAnnotation;
@BindingAnnotation(LoadTypeBinder.LoadTypeBinderFactory.class)
@保留(RetentionPolicy.RUNTIME)
@目标({ElementType.PARAMETER})
public@interface LoadTypeBinder{
/**
*价值观。
*
*@返回
*/
字符串值()默认为“it”;
类LoadTypeBinderFactory实现BinderFactory{
@凌驾
公共活页夹生成(注释){
退货(活页夹)
(q,bind,arg)->q.bind(bind.value(),arg.value());
}
}
}
尝试一下JDBI邮件列表。它更有可能在那里得到回应。