Closed
Description
code example
select(s -> s.where(id, isIn(new ArrayList<>()));
will render like this
select * from table
it should be like
select * from table where id in ()
and mysql where throw exception when execute this sql, it's what my want,
so i think there is a bug,
i found this code at org.mybatis.dynamic.sql.where.render.WhereConditionVisitor<T>
public Optional<FragmentAndParameters> visit(AbstractListValueCondition<T> condition) {
FragmentCollector fc = (FragmentCollector)condition.mapValues(this::toFragmentAndParameters).collect(FragmentCollector.collect());
return fc.isEmpty() ? Optional.empty() : FragmentAndParameters.withFragment(condition.renderCondition(this.columnName(), fc.fragments())).withParameters(fc.parameters()).buildOptional();
}
if list value condition accept an empty list, fc.isEmpty() will be true, this condition where be deleted
could anyone fix this?