Commit 737f769f6204a65e600ddff1ebd99c4de1a8edfe
1 parent
a99d92fa
Exists in
master
remove the '%' from the query.
Showing
1 changed file
with
2 additions
and
4 deletions
Show diff stats
src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java
@@ -50,10 +50,8 @@ public final class Queries { | @@ -50,10 +50,8 @@ public final class Queries { | ||
50 | public static String getQuery(String tableName, Map<String, Object> params, int nbRow) { | 50 | public static String getQuery(String tableName, Map<String, Object> params, int nbRow) { |
51 | StringJoiner join = new StringJoiner(" AND "); | 51 | StringJoiner join = new StringJoiner(" AND "); |
52 | for (Map.Entry<String, Object> param : params.entrySet()) { | 52 | for (Map.Entry<String, Object> param : params.entrySet()) { |
53 | - Class paramClass = param.getValue().getClass(); | ||
54 | - | ||
55 | - if (paramClass == String.class && !"".equals(param.getValue())) { | ||
56 | - join.add(param.getKey() + " LIKE '%" + param.getValue() + "%'"); | 53 | + if (param.getValue().getClass() == String.class) { |
54 | + join.add(param.getKey() + " LIKE '" + param.getValue() + "'"); | ||
57 | } else { | 55 | } else { |
58 | join.add(param.getKey() + " = " + param.getValue().toString()); | 56 | join.add(param.getKey() + " = " + param.getValue().toString()); |
59 | } | 57 | } |