Fix SQLWhereIn when there is no element to compare to

This commit is contained in:
Marc Baloup 2019-11-04 22:27:59 +01:00
parent bcb46b7cd5
commit d99c64721c
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,10 @@ public class SQLWhereIn extends SQLWhere {
@Override
public Pair<String, List<Object>> toSQL() throws ORMException {
List<Object> params = new ArrayList<>();
if (values.isEmpty())
return new Pair<>(" 1=0 ", params);
for (Object v : values)
SQLElement.addValueToSQLObjectList(params, field, v);