diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java b/src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java index 0e28293..d79027c 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java @@ -50,14 +50,12 @@ public final class Queries { public static String getQuery(String tableName, Map params, int nbRow) { StringJoiner join = new StringJoiner(" AND "); for (Map.Entry param : params.entrySet()) { - if (param.getValue() != null) { - Class paramClass = param.getValue().getClass(); + Class paramClass = param.getValue().getClass(); - if (paramClass == String.class && !"".equals(param.getValue())) { - join.add(param.getKey() + " LIKE '%" + param.getValue() + "%'"); - } else if (paramClass == Float.class || paramClass == Integer.class) { - join.add(param.getKey() + " = " + param.getValue().toString()); - } + if (paramClass == String.class && !"".equals(param.getValue())) { + join.add(param.getKey() + " LIKE '%" + param.getValue() + "%'"); + } else { + join.add(param.getKey() + " = " + param.getValue().toString()); } } String where = "".equals(join.toString()) ? "" : " WHERE " + join.toString(); diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java b/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java index 0913d1c..28eaf6f 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java @@ -131,8 +131,13 @@ public class RequestView extends JPanel implements ActionListener { } public void updateParam(String paramName, Object value) { - logger.info("uploading " + paramName + ": " + value); - paramValues.put(paramName, value); + if (value == null) { + paramValues.remove(paramName); + logger.info("removed " + paramName); + } else { + paramValues.put(paramName, value); + logger.info("uploaded " + paramName + ": " + value); + } updateQueryArea(); } -- libgit2 0.21.2