Fix SQLWhereIn when there is no element to compare to
This commit is contained in:
parent
bcb46b7cd5
commit
d99c64721c
@ -21,6 +21,10 @@ public class SQLWhereIn extends SQLWhere {
|
|||||||
@Override
|
@Override
|
||||||
public Pair<String, List<Object>> toSQL() throws ORMException {
|
public Pair<String, List<Object>> toSQL() throws ORMException {
|
||||||
List<Object> params = new ArrayList<>();
|
List<Object> params = new ArrayList<>();
|
||||||
|
|
||||||
|
if (values.isEmpty())
|
||||||
|
return new Pair<>(" 1=0 ", params);
|
||||||
|
|
||||||
for (Object v : values)
|
for (Object v : values)
|
||||||
SQLElement.addValueToSQLObjectList(params, field, v);
|
SQLElement.addValueToSQLObjectList(params, field, v);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user