From 737f769f6204a65e600ddff1ebd99c4de1a8edfe Mon Sep 17 00:00:00 2001 From: Nathanael Jourdane Date: Thu, 10 Mar 2016 12:15:05 +0100 Subject: [PATCH] remove the '%' from the query. --- src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 d79027c..5f4286f 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,10 +50,8 @@ 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()) { - Class paramClass = param.getValue().getClass(); - - if (paramClass == String.class && !"".equals(param.getValue())) { - join.add(param.getKey() + " LIKE '%" + param.getValue() + "%'"); + if (param.getValue().getClass() == String.class) { + join.add(param.getKey() + " LIKE '" + param.getValue() + "'"); } else { join.add(param.getKey() + " = " + param.getValue().toString()); } -- libgit2 0.21.2