由于某些原因,我无法使用BindIn,但必须使用BindBeans为in子句传递字符串值列表。我有下面,但似乎无法通过类型,因为我想。有任何建议吗?如何使用BindBeans将字符串列表输入到sql
*MyFilter {
private final String Types;
private final Timestamp Date;
public MyFilter(){
this.Types = "A','B"
THIS.Date = now();
}
}
@SqlQuery("select * from table where type in (:Types) and date = :Date ")
public abstract List<xx> get(@BindBean MyFilter filter);*
谢谢,之前提到,我不能使用BindIn,因为我需要将所有参数放在一个bean中。所以必须使用BindBean。任何建议? – chloes
我不相信有可能以这种方式使用BindBean。我认为你需要以某种方式使用BindIn - 通过获取java层的列表,或让MyFilter实现迭代(这将允许你在BindIn中使用它) – Sperr