Check empty SQLWhereChain

This commit is contained in:
Marc Baloup 2019-12-01 23:39:19 +01:00
parent 14da2611c0
commit ccaf9bf26c

View File

@ -23,6 +23,10 @@ public class SQLWhereChain extends SQLWhere {
@Override @Override
public Pair<String, List<Object>> toSQL() throws ORMException { public Pair<String, List<Object>> toSQL() throws ORMException {
if (conditions.isEmpty()) {
throw new ORMException("SQLWhereChain needs at least one element inside !");
}
String sql = ""; String sql = "";
List<Object> params = new ArrayList<>(); List<Object> params = new ArrayList<>();
boolean first = true; boolean first = true;